else if (cbdata->data != NULL && cbdata->data->len != 0) {
lua_rawgeti (cbdata->L, LUA_REGISTRYINDEX, cbdata->ref);
- if (cbdata->opaque) {
+ if (!cbdata->opaque) {
lua_pushlstring (cbdata->L, cbdata->data->str, cbdata->data->len);
}
else {
struct rspamd_lua_text *t;
t = lua_newuserdata (cbdata->L, sizeof (*t));
+ rspamd_lua_setclass (cbdata->L, "rspamd{text}", -1);
t->flags = 0;
t->len = cbdata->data->len;
t->start = cbdata->data->str;
pool:destroy()
end
-local function openphish_plain_cb(string)
+local function openphish_plain_cb(s)
local nelts = 0
local new_data = {}
local rspamd_mempool = require "rspamd_mempool"
end
end
- rspamd_str_split_fun(string, '\n', openphish_elt_parser)
+ rspamd_str_split_fun(s, '\n', openphish_elt_parser)
openphish_data = new_data
rspamd_logger.infox(openphish_hash, "parsed %s elements from openphish feed",
type = 'callback',
url = openphish_map,
callback = openphish_plain_cb,
- description = 'Open phishing feed map (see https://www.openphish.com for details)'
+ description = 'Open phishing feed map (see https://www.openphish.com for details)',
+ opaque_data = true,
})
else
openphish_hash = rspamd_config:add_map({
type = 'callback',
url = openphish_map,
callback = openphish_json_cb,
+ opaque_data = true,
description = 'Open phishing premium feed map (see https://www.openphish.com for details)'
})
end