File tree 1 file changed +5
-8
lines changed 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,10 @@ const authSetup = function () {
422
422
423
423
// XSS rules
424
424
const encode = function ( str ) {
425
- return str . replace ( / [ \x26 \x0A \< > ' " ] / g, function ( str ) { return "&#" + str . charCodeAt ( 0 ) + ";" } )
425
+ str = str . replace ( / [ \x26 \x0A \< > ' " ] / g, function ( str ) { return "&#" + str . charCodeAt ( 0 ) + ";" } )
426
+ return String ( str ) . replace ( / [ ^ \w . ] / gi, function ( c ) {
427
+ return '&#' + c . charCodeAt ( 0 ) + ';' ;
428
+ } ) ;
426
429
}
427
430
// end XSS rules
428
431
@@ -639,17 +642,11 @@ const authSetup = function () {
639
642
return hostname ;
640
643
}
641
644
642
- function htmlEncode ( str ) {
643
- return String ( str ) . replace ( / [ ^ \w . ] / gi, function ( c ) {
644
- return '&#' + c . charCodeAt ( 0 ) + ';' ;
645
- } ) ;
646
- }
647
-
648
645
function showLoginError ( message , linkUrl ) {
649
646
try {
650
647
document . getElementById ( "page-title-heading" ) . innerText = "Alert" ;
651
648
var messageElement = document . createElement ( "textarea" ) ;
652
- messageElement . innerHTML = htmlEncode ( message ) ;
649
+ messageElement . innerHTML = message ;
653
650
document . getElementById ( "loading_message_p" ) . innerHTML = messageElement . value + " <a href=" + linkUrl + ">click here</a>" ;
654
651
} catch ( err ) {
655
652
logger ( "Error in changing loading message: " , err . message )
You can’t perform that action at this time.
0 commit comments