summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/sauth.lua1
-rw-r--r--libs/web/luasrc/template.lua6
2 files changed, 3 insertions, 4 deletions
diff --git a/libs/web/luasrc/sauth.lua b/libs/web/luasrc/sauth.lua
index d838f84f6..fc4942b97 100644
--- a/libs/web/luasrc/sauth.lua
+++ b/libs/web/luasrc/sauth.lua
@@ -14,6 +14,7 @@ $Id$
]]--
module("luci.sauth", package.seeall)
require("luci.fs")
+require("luci.util")
require("luci.config")
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index dc0ccf620..12b80bec8 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)