From: Jo-Philipp Wich Date: Fri, 24 Dec 2010 21:39:26 +0000 (+0000) Subject: libs/core: bring get_first() boolean casting in line with get_bool() X-Git-Tag: 0.10.0~266 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=0f9f2a42a4b54e497090940d18a852c15b2a1b8a;hp=1b94b364980a5fa35f21eb861cc4c720390a2276 libs/core: bring get_first() boolean casting in line with get_bool() --- diff --git a/libs/core/luasrc/model/uci.lua b/libs/core/luasrc/model/uci.lua index 270877677..e42856bd5 100644 --- a/libs/core/luasrc/model/uci.lua +++ b/libs/core/luasrc/model/uci.lua @@ -184,7 +184,8 @@ function Cursor.get_first(self, conf, stype, opt, def) if type(def) == "number" then val = tonumber(val) 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 if val ~= nil then