From d46da53bcd1f822d5b11772fc85b475b9d9174ff Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Wed, 31 Jan 2024 02:25:33 +0100 Subject: [PATCH] luci-lilb-nixio: Code quality fixes future variants could use en/decodeURIComponent ordering is important when handling "&" Signed-off-by: Paul Donald --- libs/luci-lib-nixio/axTLS/www/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.30.2