summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/cbi.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-20 18:08:18 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-20 18:08:18 +0000
commitff58e81d18a23fcbdfea89044b0600bcdd2d06da (patch)
tree3d8ffee134f250a656c4afe6cec9f6d760299abf /libs/web/luasrc/cbi.lua
parentaa0f710867cc4333df4efa3fdb45ae2ed51e9c50 (diff)
libs/web: skip empty values in DynList widget
Diffstat (limited to 'libs/web/luasrc/cbi.lua')
-rw-r--r--libs/web/luasrc/cbi.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua
index 6c9e7a544f..50b594b4ce 100644
--- a/libs/web/luasrc/cbi.lua
+++ b/libs/web/luasrc/cbi.lua
@@ -1662,7 +1662,9 @@ function DynamicList.write(self, section, value)
elseif self.cast == "table" and type(value) == "string" then
local x, t = { }
for x in value:gmatch("%S+") do
- t[#t+1] = x
+ if #x > 0 then
+ t[#t+1] = x
+ end
end
value = t
end
@@ -1677,7 +1679,9 @@ function DynamicList.cfgvalue(self, section)
local x
local t = { }
for x in value:gmatch("%S+") do
- t[#t+1] = x
+ if #x > 0 then
+ t[#t+1] = x
+ end
end
value = t
end