commit b5bed7d: [Fix] Return true from has_urls(true) if only emails are present

Pragadeesh Chandiran pchandiran at mimecast.com
Thu Dec 22 22:56:03 UTC 2022


Author: Pragadeesh Chandiran
Date: 2022-12-22 14:47:16 -0500
URL: https://github.com/rspamd/rspamd/commit/b5bed7ddf2dc46f9c990a06db88904e80b1a18fd (refs/pull/4365/head)

[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));


More information about the Commits mailing list