From: Paul Donald Date: Wed, 31 Jan 2024 01:25:33 +0000 (+0100) Subject: luci-lilb-nixio: Code quality fixes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d46da53bcd1f822d5b11772fc85b475b9d9174ff;p=project%2Fluci.git luci-lilb-nixio: Code quality fixes future variants could use en/decodeURIComponent ordering is important when handling "&" Signed-off-by: Paul Donald --- diff --git a/libs/luci-lib-nixio/axTLS/www/index.html b/libs/luci-lib-nixio/axTLS/www/index.html index 25cd2e69b1..9896cd8a54 100755 --- a/libs/luci-lib-nixio/axTLS/www/index.html +++ b/libs/luci-lib-nixio/axTLS/www/index.html @@ -5943,10 +5943,10 @@ String.prototype.htmlEncode = function() return(this.replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,""")); } -// Convert "&" to &, "<" to <, ">" to > and """ to " +// Convert "<" to <, ">" to >, """ to " and "&" to & (& handled last for security reasons) String.prototype.htmlDecode = function() { - return(this.replace(/&/mg,"&").replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\"")); + return(this.replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\"").replace(/&/mg,"&")); } // Parse a space-separated string of name:value parameters where: