if STRICT_UNKNOWN_OPTIONS and not section:scheme('dynamic') then
for k, v in pairs(section:config()) do
local oo = section:option(k)
- if k:byte(1) == 46 and not self.beenthere[oo:cid()] then
+ if k:byte(1) ~= 46 and not self.beenthere[oo:cid()] then
section:error(ERR('OPT_UNKNOWN', oo))
end
end
local util = require "luci.util"
local string = require "string"
-local luci, tonumber, unpack, ipairs, type =
- luci, tonumber, unpack, ipairs, type
+local luci, tonumber, tostring, unpack, ipairs, type =
+ luci, tonumber, tostring, unpack, ipairs, type
module "luci.uvl.errors"
:gsub("%%s", self.section or '(nil)')
:gsub("%%S", self.stype or '(nil)')
:gsub("%%o", self.option or '(nil)')
- :gsub("%%v", self.value or '(nil)')
+ :gsub("%%v", self.value and tostring(self.value) or '(nil)')
:gsub("%%t", self.object and self.object:type() or '(nil)' )
:gsub("%%T", self.object and self.object:title() or '(nil)' )
:gsub("%%([1-9])", function(n) return self.args[tonumber(n)] or '(nil)' end)
)
ok, err = uvl:validate_config( cso[1], uci:get_all(cso[1]) )
- if err then err.code = luci.uvl.errors.ERR_SCHEME end
+ if err then err.code = 'SCHEME' end
else
ok, err = uvl:validate( unpack(cso) )
end