diff options
author | Steven Barth <steven@midlink.org> | 2008-08-28 15:50:27 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-28 15:50:27 +0000 |
commit | ba22660cb82d0f34bc1080c1fcfec539ef3634eb (patch) | |
tree | 5a38b5a192eea476b968ffbe57a159523ba2829e /libs/cbi | |
parent | b5b0914ae3d05010f8c67766af799285cb888635 (diff) |
libs/core: Add recursion detection to dumptable, serialize_data
Dumptable now writes to stderr
Diffstat (limited to 'libs/cbi')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 0a406c43e..411aa2387 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -616,6 +616,13 @@ function NamedSection.parse(self) AbstractSection.parse_dynamic(self, s) if luci.http.formvalue("cbi.submit") then Node.parse(self, s) + + if not self.override_scheme and self.map.scheme then + local co = self.map:get() + local stat, err = self.map.validator:validate_section(self.config, s, co) + luci.http.prepare_content("text/html") + luci.util.dumptable(err) + end end AbstractSection.parse_optionals(self, s) end @@ -705,10 +712,17 @@ function TypedSection.parse(self) end end + local co for i, k in ipairs(self:cfgsections()) do AbstractSection.parse_dynamic(self, k) if luci.http.formvalue("cbi.submit") then Node.parse(self, k) + + if not self.override_scheme and self.map.scheme then + co = co or self.map:get() + local stat, err = self.map.uvl:validate_section(self.config, k, co) + luci.util.perror(err) + end end AbstractSection.parse_optionals(self, k) end |