jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/324448 )
Change subject: Properly escape in ext.translate.multiselectautocomplete.js ...................................................................... Properly escape in ext.translate.multiselectautocomplete.js In Special:PageTranslation language names were not properly escaped. Ideally this would use some OOjs UI widget instead. Change-Id: I8016d486a0858b8405604723a5f9cb65dd8f95cd --- M resources/js/ext.translate.multiselectautocomplete.js 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.translate.multiselectautocomplete.js b/resources/js/ext.translate.multiselectautocomplete.js index d98f64f..4e7a764 100644 --- a/resources/js/ext.translate.multiselectautocomplete.js +++ b/resources/js/ext.translate.multiselectautocomplete.js @@ -37,18 +37,22 @@ matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), 'i' ); response( select.children( 'option' ).map( function () { - var text = $( this ).text(), + var text = $( this ).html(), value = $( this ).val(), term = split( request.term ).pop(); if ( this.value && ( !request.term || matcher.test( text ) ) ) { - return { - label: text.replace( + if ( term.trim() !== '' ) { + text = text.replace( new RegExp( '(?![^&;]+;)(?!<[^<>]*)(' + $.ui.autocomplete.escapeRegex( term ) + ')(?![^<>]*>)(?![^&;]+;)', 'gi' - ), '<strong>$1</strong>' ), + ), '<strong>$1</strong>' ); + } + + return { + label: text, value: value, option: this }; -- To view, visit https://gerrit.wikimedia.org/r/324448 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8016d486a0858b8405604723a5f9cb65dd8f95cd Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits