From: Paul Donald Date: Sat, 3 Feb 2024 15:14:35 +0000 (+0100) Subject: luci-lib-nixio: Code quality fixes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=21210dc2fb001f0a2a0c7195230d03147cd89e69;p=project%2Fluci.git luci-lib-nixio: Code quality fixes future variants could use en/decodeURIComponent ordering is important when handling "&" Signed-off-by: Paul Donald (cherry picked from commit d46da53bcd1f822d5b11772fc85b475b9d9174ff) --- 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: