Several escaping fixes
[project/luci.git] / libs / core / luasrc / util.lua
index 51d66e0..ef1b8fe 100644 (file)
@@ -199,6 +199,8 @@ end
 -- @param value        String value containing the data to escape
 -- @return             String value containing the escaped data
 function pcdata(value)
+       if not value then return end
+       value = tostring(value)
        value = value:gsub("&", "&")
        value = value:gsub('"', """)
        value = value:gsub("'", "'")