From: Jo-Philipp Wich Date: Sun, 7 Nov 2010 20:01:12 +0000 (+0000) Subject: libs/web: support local destination in zonelist widget X-Git-Tag: 0.10.0~519 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d26ceda459234aa239f43a3744181ddbe5a6adfe;p=oweals%2Fluci.git libs/web: support local destination in zonelist widget --- diff --git a/libs/web/luasrc/view/cbi/firewall_zonelist.htm b/libs/web/luasrc/view/cbi/firewall_zonelist.htm index 891c70e77..037b75081 100644 --- a/libs/web/luasrc/view/cbi/firewall_zonelist.htm +++ b/libs/web/luasrc/view/cbi/firewall_zonelist.htm @@ -21,23 +21,31 @@ $Id$ local zone, net, iface local zones = fwm:get_zones() local value = self:formvalue(section) - if not value or value == "-" then value = self:cfgvalue(section) or self.default end + if not value or value == "-" then + value = self:cfgvalue(section) or self.default + end local selected = false local checked = { } - if value and #value == 0 then - value = nil - elseif type(value) == "table" then - for _, value in ipairs(value) do - checked[value] = true - end - elseif value then + for value in utl.imatch(value) do checked[value] = true end + + if not next(checked) then + checked[""] = true + end -%>