From 0f9f2a42a4b54e497090940d18a852c15b2a1b8a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 24 Dec 2010 21:39:26 +0000 Subject: [PATCH] libs/core: bring get_first() boolean casting in line with get_bool() --- libs/core/luasrc/model/uci.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.25.1