lua-simple-uci: remove support for obsolete alternative boolean strings
This commit is contained in:
parent
0fbef92e84
commit
c9fa162ebb
|
@ -93,7 +93,7 @@ end
|
||||||
|
|
||||||
function Cursor:get_bool(...)
|
function Cursor:get_bool(...)
|
||||||
local val = self:get(...)
|
local val = self:get(...)
|
||||||
return ( val == "1" or val == "true" or val == "yes" or val == "on" )
|
return val == "1"
|
||||||
end
|
end
|
||||||
|
|
||||||
function Cursor:get_list(config, section, option)
|
function Cursor:get_list(config, section, option)
|
||||||
|
@ -114,8 +114,7 @@ function Cursor:get_first(conf, stype, opt, def)
|
||||||
if type(def) == "number" then
|
if type(def) == "number" then
|
||||||
val = tonumber(val)
|
val = tonumber(val)
|
||||||
elseif type(def) == "boolean" then
|
elseif type(def) == "boolean" then
|
||||||
val = (val == "1" or val == "true" or
|
val = val == "1"
|
||||||
val == "yes" or val == "on")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if val ~= nil then
|
if val ~= nil then
|
||||||
|
|
Loading…
Reference in New Issue