static inline void
luaL_register (lua_State *L, const gchar *name, const struct luaL_reg *methods)
{
- lua_newtable (L);
+ if (name != NULL) {
+ lua_newtable (L);
+ }
luaL_setfuncs (L, methods, 0);
if (name != NULL) {
lua_pushvalue (L, -1);
local pat = "(.-)" .. delim .. "()"
local nb = 0
local lastPos
- for part, pos in string.gfind(str, pat) do
+ for part, pos in string.gmatch(str, pat) do
nb = nb + 1
result[nb] = part
lastPos = pos
local found = false
local purl = url:get_phished()
if table.maxn(strict_domains) > 0 then
- local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+\.[a-zA-Z0-9%-]+)$')
+ local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$')
if tld then
for _,rule in ipairs(strict_domains) do
if rule['map']:get_key(tld) then
end
if not found then
if domains then
- local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+\.[a-zA-Z0-9%-]+)$')
+ local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$')
if tld then
if domains:get_key(tld) then
task:insert_result(symbol, 1, purl:get_host())