From: Pragadeesh Chandiran Date: Thu, 22 Dec 2022 19:47:16 +0000 (-0500) Subject: [Fix] Return true from has_urls(true) if only emails are present X-Git-Tag: 3.5~135^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4365%2Fhead;p=thirdparty%2Frspamd.git [Fix] Return true from has_urls(true) if only emails are present --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 3288b83850..f19d424fea 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2605,17 +2605,17 @@ lua_task_has_urls (lua_State * L) { LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); - bool need_urls = false; + bool need_emails = false; gboolean ret = FALSE; gsize sz = 0; if (task) { if (task->message) { if (lua_gettop (L) >= 2) { - need_urls = lua_toboolean (L, 2); + need_emails = lua_toboolean (L, 2); } - if (!need_urls) { + if (need_emails) { /* Simplified check */ if (kh_size (MESSAGE_FIELD (task, urls)) > 0) { sz += kh_size (MESSAGE_FIELD (task, urls));