summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/cbi.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-07 21:22:39 +0000
committerSteven Barth <steven@midlink.org>2008-09-07 21:22:39 +0000
commitd8282d382bc675eb1c930eed0fe65c41050400b8 (patch)
tree8a66bd056d4e92b31366dbe70f96b0d29481919c /libs/cbi/luasrc/cbi.lua
parenta8c64ef3b09e8d64ae1c0497b9b852a0d98fdf64 (diff)
libs/cbi: Catch errors while creating named sections
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r--libs/cbi/luasrc/cbi.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index a37e81e87..3e7209781 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -566,7 +566,7 @@ function AbstractSection.create(self, section)
local stat
if section then
- stat = self.map:set(section, nil, self.sectiontype)
+ stat = section:match("^%w+$") and self.map:set(section, nil, self.sectiontype)
else
section = self.map:add(self.sectiontype)
stat = section
@@ -795,6 +795,9 @@ function TypedSection.parse(self, novld)
if name and #name > 0 then
created = self:create(name) and name
+ if not created then
+ self.invalid_cts = true
+ end
end
end
end