Use Unicode '\u00A0' instead of HTML ' '

The .html() can replaced by .text() which avoids a possible JavaScript
injection by a malicious message.

Change-Id: Iffdf13299db6fb4ccd8a35b9df4c2f235646ea9d
This commit is contained in:
Fomafix
2023-04-24 09:43:39 +00:00
parent 29dfbbdd72
commit 69ddc959ac

View File

@@ -199,8 +199,7 @@
$( '<p>' ).append(
$( '<span>' )
.addClass( 'uls-display-settings-anon-label' )
// .html() is needed for correct parsing of the nbsp
.html( $.i18n( 'ext-uls-display-settings-anon-label' ) + '&#160;' ),
.text( $.i18n( 'ext-uls-display-settings-anon-label' ) + '\u00A0' ),
$( '<span>' )
.text( $.i18n( 'ext-uls-display-settings-anon-same-as-content', autonym ) )
),