Skip to content

Commit a0cf3fa

Browse files
Fixes
1 parent e5ef5bf commit a0cf3fa

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)