Skip to content

Commit

Permalink
luci-lilb-nixio: Code quality fixes
Browse files Browse the repository at this point in the history
future variants could use en/decodeURIComponent

ordering is important when handling "&"

Signed-off-by: Paul Donald <newtwen@gmail.com>
  • Loading branch information
systemcrash committed Jan 31, 2024
1 parent 74b8902 commit d46da53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/luci-lib-nixio/axTLS/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5943,10 +5943,10 @@
return(this.replace(/&/mg,"&amp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;").replace(/\"/mg,"&quot;"));
}

// Convert "&amp;" to &, "&lt;" to <, "&gt;" to > and "&quot;" to "
// Convert "&lt;" to <, "&gt;" to >, "&quot;" to " and "&amp;" to & (& handled last for security reasons)
String.prototype.htmlDecode = function()
{
return(this.replace(/&amp;/mg,"&").replace(/&lt;/mg,"<").replace(/&gt;/mg,">").replace(/&quot;/mg,"\""));
return(this.replace(/&lt;/mg,"<").replace(/&gt;/mg,">").replace(/&quot;/mg,"\"").replace(/&amp;/mg,"&"));
}

// Parse a space-separated string of name:value parameters where:
Expand Down

0 comments on commit d46da53

Please sign in to comment.