libs/web: Fixed template escaping
This commit is contained in:
parent
aa462baa33
commit
14e62cc311
2 changed files with 8 additions and 8 deletions
|
@ -80,17 +80,17 @@ function compile(template)
|
||||||
template = sanitize(template)
|
template = sanitize(template)
|
||||||
|
|
||||||
-- Template module header/footer declaration
|
-- Template module header/footer declaration
|
||||||
local header = "write('"
|
local header = 'write("'
|
||||||
local footer = "')"
|
local footer = '")'
|
||||||
|
|
||||||
template = header .. template .. footer
|
template = header .. template .. footer
|
||||||
|
|
||||||
-- Replacements
|
-- Replacements
|
||||||
local r_include = "')\ninclude('%s')\nwrite('"
|
local r_include = '")\ninclude("%s")\nwrite("'
|
||||||
local r_i18n = "'..translate('%1','%2')..'"
|
local r_i18n = '"..translate("%1","%2").."'
|
||||||
local r_i18n2 = "'..translate('%1', '')..'"
|
local r_i18n2 = '"..translate("%1", "").."'
|
||||||
local r_pexec = "'..(%s or '')..'"
|
local r_pexec = '"..(%s or "").."'
|
||||||
local r_exec = "')\n%s\nwrite('"
|
local r_exec = '")\n%s\nwrite("'
|
||||||
|
|
||||||
-- Parse the expressions
|
-- Parse the expressions
|
||||||
for k,v in pairs(expr) do
|
for k,v in pairs(expr) do
|
||||||
|
|
|
@ -28,6 +28,6 @@ if not reboot then
|
||||||
<p><a href="<%=REQUEST_URI%>?reboot=1"><%:a_s_reboot_do%></a></p>
|
<p><a href="<%=REQUEST_URI%>?reboot=1"><%:a_s_reboot_do%></a></p>
|
||||||
<%- else -%>
|
<%- else -%>
|
||||||
<p><%:a_s_reboot_running%></p>
|
<p><%:a_s_reboot_running%></p>
|
||||||
<script type="text/javascript">setTimeout("location='<%=controller%>/admin'", 60000)</script>
|
<script type="text/javascript">setTimeout("location='<%=controller%>'", 60000)</script>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%+footer%>
|
<%+footer%>
|
Loading…
Reference in a new issue