luci-lilb-nixio: Code quality fixes
future variants could use en/decodeURIComponent ordering is important when handling "&" Signed-off-by: Paul Donald <newtwen@gmail.com>
This commit is contained in:
parent
74b89027d3
commit
d46da53bcd
1 changed files with 2 additions and 2 deletions
|
@ -5943,10 +5943,10 @@ String.prototype.htmlEncode = function()
|
||||||
return(this.replace(/&/mg,"&").replace(/</mg,"<").replace(/>/mg,">").replace(/\"/mg,"""));
|
return(this.replace(/&/mg,"&").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()
|
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:
|
// Parse a space-separated string of name:value parameters where:
|
||||||
|
|
Loading…
Reference in a new issue