From b5bed7ddf2dc46f9c990a06db88904e80b1a18fd Mon Sep 17 00:00:00 2001 From: Pragadeesh Chandiran Date: Thu, 22 Dec 2022 14:47:16 -0500 Subject: [PATCH] [Fix] Return true from has_urls(true) if only emails are present --- src/lua/lua_task.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 3288b8385..f19d424fe 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)); -- 2.39.5