aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-23 12:37:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-23 14:45:27 +0100
commit3db95ac8fe0b1b036fcef470d5244c9159a6b2ba (patch)
tree73cb196617a40a250182f7bd8ee6bb833173ef91
parent49267b5a003e9145283c043bd523a037d7b38370 (diff)
downloadrspamd-3db95ac8fe0b1b036fcef470d5244c9159a6b2ba.tar.gz
rspamd-3db95ac8fe0b1b036fcef470d5244c9159a6b2ba.zip
[Fix] Fix creating of URLs from LUA
-rw-r--r--src/lua/lua_url.c6
1 files changed, 5 insertions, 1 deletions
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);