* luci/themes: fix xml errors triggered by query strings in menu entries
[project/luci.git] / themes / openwrt.org / luasrc / view / themes / openwrt.org / header.htm
index b3a53c5..6e460d5 100644 (file)
@@ -31,19 +31,19 @@ for i,r in ipairs(request) do
 end
 
 require("luci.i18n").loadc("default")
-require("luci.http").prepare_content("text/html")
+require("luci.http").prepare_content("application/xhtml+xml")
 
 -%>
 
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
        <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
        <% if node and node.css then %><link rel="stylesheet" type="text/css" href="<%=resource%>/<%=node.css%>" /><% end %>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
        <meta http-equiv="content-script-type" content="text/javascript" />
-       <title><%= hostname .. ( (node and node.title) and ' - ' .. node.title or '') %> - LuCI</title>
+       <title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI</title>
 
        <!--[if lt IE 7]>
                <script type="text/javascript">
@@ -55,14 +55,14 @@ require("luci.http").prepare_content("text/html")
 
                                var lis  = document.getElementById("mainmenu").getElementsByTagName("LI");
                                var divs = document.getElementById("mainmenu").getElementsByTagName("DIV");
-                               
+
                                for( var i = 0; i < lis.length;  i++ ) ie_hover( lis[i]  );
                                for( var i = 0; i < divs.length; i++ ) ie_hover( divs[i] );
                        }
                </script>
        <![endif]-->
 </head>
-<body onload="window.setup_hover && setup_hover()">
+<body onload="window.setup_hover &amp;&amp; setup_hover()">
 <div id="header">
        <div class="info whitetext smalltext bold right">
        <%=luci.config.brand.firmware%><br />
@@ -118,7 +118,7 @@ local function submenu(prefix, node)
                        href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
                %>
                <li>
-                       <span<% if nnode._menu_selected then %> class="active"<%end%>><a href="<%=href%>"><%=nnode.title%></a></span>
+                       <span<% if nnode._menu_selected then %> class="active"<%end%>><a href="<%=luci.util.pcdata(href)%>"><%=nnode.title%></a></span>
                        <%- submenu(prefix .. v.name .. "/", nnode) %>
                </li>
                <%- end %>
@@ -162,9 +162,7 @@ end
        <%
                if tree.nodes[category] and tree.nodes[category].ucidata then
                        local ucic = 0
-                       require("luci.model.uci")
-                       luci.model.uci.set_savedir(luci.model.uci.savedir_default)
-                       for i, j in pairs(luci.model.uci.changes()) do
+                       for i, j in pairs(require("luci.model.uci").cursor():changes()) do
                                for k, l in pairs(j) do
                                        for m, n in pairs(l) do
                                                ucic = ucic + 1;