libs/cbi: allow underscores in AbstractSection.create()
[project/luci.git] / libs / cbi / luasrc / cbi.lua
index 23a5f01..1b22db0 100644 (file)
@@ -931,7 +931,7 @@ function AbstractSection.create(self, section)
        local stat
 
        if section then
-               stat = section:match("^%w+$") and 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