* luci/libs/core: use numeric entities in pcdata()

This commit is contained in:
Jo-Philipp Wich 2008-10-24 19:15:09 +00:00
parent bf21777126
commit 9451a49408

View file

@ -195,11 +195,11 @@ end
-- @return String value containing the escaped data -- @return String value containing the escaped data
function pcdata(value) function pcdata(value)
return value and tostring(value):gsub("[&\"'<>]", { return value and tostring(value):gsub("[&\"'<>]", {
["&"] = "&amp;", ["&"] = "&#38;",
['"'] = "&quot;", ['"'] = "&#34;",
["'"] = "&apos;", ["'"] = "&#39;",
["<"] = "&lt;", ["<"] = "&#60;",
[">"] = "&gt;" [">"] = "&#62;"
}) })
end end