File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -639,11 +639,17 @@ const authSetup = function () {
639639 return hostname ;
640640 }
641641
642+ function htmlEncode ( str ) {
643+ return String ( str ) . replace ( / [ ^ \w . ] / gi, function ( c ) {
644+ return '&#' + c . charCodeAt ( 0 ) + ';' ;
645+ } ) ;
646+ }
647+
642648 function showLoginError ( message , linkUrl ) {
643649 try {
644650 document . getElementById ( "page-title-heading" ) . innerText = "Alert" ;
645651 var messageElement = document . createElement ( "textarea" ) ;
646- messageElement . innerHTML = message ;
652+ messageElement . innerHTML = htmlEncode ( message ) ;
647653 document . getElementById ( "loading_message_p" ) . innerHTML = messageElement . value + " <a href=" + linkUrl + ">click here</a>" ;
648654 } catch ( err ) {
649655 logger ( "Error in changing loading message: " , err . message )
You can’t perform that action at this time.
0 commit comments