From: Vsevolod Stakhov Date: Sat, 23 Apr 2016 11:37:15 +0000 (+0100) Subject: [Fix] Fix creating of URLs from LUA X-Git-Tag: 1.3.0~660 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3db95ac8fe0b1b036fcef470d5244c9159a6b2ba;p=rspamd.git [Fix] Fix creating of URLs from LUA --- diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c index 3e97bbd11..24c3f9a70 100644 --- a/src/lua/lua_url.c +++ b/src/lua/lua_url.c @@ -487,10 +487,14 @@ lua_url_create (lua_State *L) text = luaL_checklstring (L, 2, &length); if (text != NULL) { - lua_newtable (L); rspamd_url_find_single (pool, text, length, FALSE, lua_url_single_inserter, L); + if (lua_type (L, -1) != LUA_TUSERDATA) { + /* URL is actually not found */ + lua_pushnil (L); + } + } else { lua_pushnil (L);