mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	Forbid HTML injection using jQuery (#29843)
See https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/no-append-html.md Tested the following components and they work as before: - notification table - issue author dropdown - comment edit box attachments div Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		| @@ -436,13 +436,12 @@ async function onEditContent(event) { | ||||
|       const $content = $segment; | ||||
|       if (!$content.find('.dropzone-attachments').length) { | ||||
|         if (data.attachments !== '') { | ||||
|           $content.append(`<div class="dropzone-attachments"></div>`); | ||||
|           $content.find('.dropzone-attachments').replaceWith(data.attachments); | ||||
|           $content[0].append(data.attachments); | ||||
|         } | ||||
|       } else if (data.attachments === '') { | ||||
|         $content.find('.dropzone-attachments').remove(); | ||||
|       } else { | ||||
|         $content.find('.dropzone-attachments').replaceWith(data.attachments); | ||||
|         $content.find('.dropzone-attachments')[0].outerHTML = data.attachments; | ||||
|       } | ||||
|       if (dz) { | ||||
|         dz.emit('submit'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user