Browse Source

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

tags/3.5
Pragadeesh Chandiran 1 year ago
parent
commit
b5bed7ddf2
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/lua/lua_task.c

+ 3
- 3
src/lua/lua_task.c View File

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

Loading…
Cancel
Save