File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,10 @@ const authSetup = function () {
422422
423423 // XSS rules
424424 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+ } ) ;
426429 }
427430 // end XSS rules
428431
@@ -639,17 +642,11 @@ const authSetup = function () {
639642 return hostname ;
640643 }
641644
642- function htmlEncode ( str ) {
643- return String ( str ) . replace ( / [ ^ \w . ] / gi, function ( c ) {
644- return '&#' + c . charCodeAt ( 0 ) + ';' ;
645- } ) ;
646- }
647-
648645 function showLoginError ( message , linkUrl ) {
649646 try {
650647 document . getElementById ( "page-title-heading" ) . innerText = "Alert" ;
651648 var messageElement = document . createElement ( "textarea" ) ;
652- messageElement . innerHTML = htmlEncode ( message ) ;
649+ messageElement . innerHTML = message ;
653650 document . getElementById ( "loading_message_p" ) . innerHTML = messageElement . value + " <a href=" + linkUrl + ">click here</a>" ;
654651 } catch ( err ) {
655652 logger ( "Error in changing loading message: " , err . message )
You can’t perform that action at this time.
0 commit comments