diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-28 19:15:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-28 19:15:43 +0100 |
commit | 183c35be356cae5cc0bd01a08a79d4b37b831b52 (patch) | |
tree | 1058717a9d6792036a0629b3f5e310da29ca0951 /src | |
parent | 0431c5f85f77cd6bd92ed4c0f29e5dccfe41811a (diff) | |
download | rspamd-183c35be356cae5cc0bd01a08a79d4b37b831b52.tar.gz rspamd-183c35be356cae5cc0bd01a08a79d4b37b831b52.zip |
[Minor] Allow rspamd_text in rspamd_url.create
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_url.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c index ebb7e7534..f8c81cb93 100644 --- a/src/lua/lua_url.c +++ b/src/lua/lua_url.c @@ -741,26 +741,25 @@ lua_url_create (lua_State *L) { LUA_TRACE_POINT; rspamd_mempool_t *pool; - const gchar *text; - size_t length; + struct rspamd_lua_text *t; gboolean own_pool = FALSE; struct rspamd_lua_url *u; if (lua_type (L, 1) == LUA_TUSERDATA) { pool = rspamd_lua_check_mempool (L, 1); - text = luaL_checklstring (L, 2, &length); + t = lua_check_text_or_string (L, 2); } else { own_pool = TRUE; pool = static_lua_url_pool; - text = luaL_checklstring (L, 1, &length); + t = lua_check_text_or_string (L, 2); } - if (pool == NULL || text == NULL) { + if (pool == NULL || t == NULL) { return luaL_error (L, "invalid arguments"); } else { - rspamd_url_find_single (pool, text, length, RSPAMD_URL_FIND_ALL, + rspamd_url_find_single (pool, t->start, t->len, RSPAMD_URL_FIND_ALL, lua_url_single_inserter, L); if (lua_type (L, -1) != LUA_TUSERDATA) { |