summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/template.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-26 17:24:46 +0000
committerSteven Barth <steven@midlink.org>2008-07-26 17:24:46 +0000
commite5df13e80e7b652492e6d2b26afca43e94262e29 (patch)
tree9abec5db04221eac266f49964b5c22298b663272 /libs/web/luasrc/template.lua
parent47774572e08b64da90c834410637e92e8b2a9051 (diff)
libs: Fixed serialization stuff
Diffstat (limited to 'libs/web/luasrc/template.lua')
-rw-r--r--libs/web/luasrc/template.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index dc0ccf6201..12b80bec8e 100644
--- a/libs/web/luasrc/template.lua
+++ b/libs/web/luasrc/template.lua
@@ -68,10 +68,8 @@ function compile(template)
template = template:gsub("(%s*)<%%(%-?)(.-)(%-?)%%>(%s*)", expr_add)
local function sanitize(s)
- s = luci.util.escape(s)
- s = luci.util.escape(s, "'")
- s = luci.util.escape(s, "\n")
- return s
+ s = string.format("%q", s)
+ return s:sub(2, #s-1)
end
-- Escape and sanitize all the template (all non-expressions)