From: Vsevolod Stakhov Date: Thu, 12 Feb 2026 17:35:32 +0000 (+0000) Subject: [Fix] Handle native boolean values in lua_util.toboolean() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ef9396dfd9c308f74fc67e4799c92c1bf9ea5c3;p=thirdparty%2Frspamd.git [Fix] Handle native boolean values in lua_util.toboolean() toboolean() only handled string and number inputs, falling through to the error branch for native Lua booleans and always returning false. This broke the fuzzy_check "checks" configuration block since UCL converts boolean values to native Lua booleans, and apply_checks_overrides in lua_fuzzy.lua passes them through toboolean() via bool_opt(). Fixes: #5775 --- diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index dfc9ff0334..bc63861c42 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -1750,7 +1750,9 @@ exports.toboolean = function(v) ['False'] = false, }; - if type(v) == 'string' then + if type(v) == 'boolean' then + return v + elseif type(v) == 'string' then if true_t[v] == true then return true; elseif false_t[v] == false then