libs/web: Fixed template escaping
authorSteven Barth <steven@midlink.org>
Thu, 31 Jul 2008 09:54:09 +0000 (09:54 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 31 Jul 2008 09:54:09 +0000 (09:54 +0000)
libs/web/luasrc/template.lua
modules/admin-mini/luasrc/view/mini/reboot.htm

index 17e1daad70b83e9c6f74dafce5340fcc558189d3..659c7216d8ebc588fdfa1eeee085d55a2a18f65c 100644 (file)
@@ -80,17 +80,17 @@ function compile(template)
        template = sanitize(template)
 
        -- Template module header/footer declaration
-       local header = "write('"
-       local footer = "')"
+       local header = 'write("'
+       local footer = '")'
        
        template = header .. template .. footer
        
        -- Replacements
-       local r_include = "')\ninclude('%s')\nwrite('"
-       local r_i18n    = "'..translate('%1','%2')..'"
-       local r_i18n2    = "'..translate('%1', '')..'"
-       local r_pexec   = "'..(%s or '')..'"
-       local r_exec    = "')\n%s\nwrite('"
+       local r_include = '")\ninclude("%s")\nwrite("'
+       local r_i18n    = '"..translate("%1","%2").."'
+       local r_i18n2    = '"..translate("%1", "").."'
+       local r_pexec   = '"..(%s or "").."'
+       local r_exec    = '")\n%s\nwrite("'
        
        -- Parse the expressions
        for k,v in pairs(expr) do
index b0f64698d5a4e9a1b56016a469ba23e9535655dd..6ef8603f06c4a2afd5d5dc1d8cad075566e17b80 100644 (file)
@@ -28,6 +28,6 @@ if not reboot then
 <p><a href="<%=REQUEST_URI%>?reboot=1"><%:a_s_reboot_do%></a></p>
 <%- else -%>
 <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 -%>
 <%+footer%>
\ No newline at end of file