libs/core: bring get_first() boolean casting in line with get_bool()

This commit is contained in:
Jo-Philipp Wich 2010-12-24 21:39:26 +00:00
parent 1b94b36498
commit 0f9f2a42a4

View file

@ -184,7 +184,8 @@ function Cursor.get_first(self, 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 == "enabled") val = (val == "1" or val == "true" or
val == "yes" or val == "on")
end end
if val ~= nil then if val ~= nil then