* luci/themes: do an explicit check for table data type on result of uci.changes()
[oweals/luci.git] / themes / openwrt.org / luasrc / view / themes / openwrt.org / header.htm
index 4efde4a62c85d3a8bb8b1401e3b0228916f8f6ad..f18d0bce3944fae5649ccf22f3f98c0721ba7133 100644 (file)
@@ -120,9 +120,14 @@ end
                <%
                        if "admin" == request[1] then
                                require("luci.model.uci") 
-                               local ucic = luci.model.uci.changes()
-                               if ucic then
-                                       ucic = #luci.util.split(ucic)
+                               local ucic = 0
+                                local changes = luci.model.uci.changes()
+                               if type(changes) == "table" then        -- XXX: sometimes string or nil / needs investigation
+                                       for n, s in pairs(changes) do
+                                               for no, o in pairs(s) do
+                                                       ucic = ucic + 1;
+                                               end
+                                       end
                                end
                %>
                <div><%:config Konfiguration%>
@@ -138,4 +143,4 @@ end
                </div>
                <% end %>
        </div>
-       <div id="content">
\ No newline at end of file
+       <div id="content">