LUA_FUNCTION_DEF (url, is_phished);
LUA_FUNCTION_DEF (url, is_redirected);
LUA_FUNCTION_DEF (url, is_obscured);
+LUA_FUNCTION_DEF (url, is_html_displayed);
LUA_FUNCTION_DEF (url, get_phished);
LUA_FUNCTION_DEF (url, get_tag);
LUA_FUNCTION_DEF (url, get_tags);
LUA_INTERFACE_DEF (url, is_phished),
LUA_INTERFACE_DEF (url, is_redirected),
LUA_INTERFACE_DEF (url, is_obscured),
+ LUA_INTERFACE_DEF (url, is_html_displayed),
LUA_INTERFACE_DEF (url, get_phished),
LUA_INTERFACE_DEF (url, get_tag),
LUA_INTERFACE_DEF (url, get_tags),
return 1;
}
+
+/***
+ * @method url:is_html_displayed()
+ * Check whether URL is just displayed in HTML (e.g. NOT a real href)
+ * @return {boolean} `true` if URL is displayed only
+ */
+static gint
+lua_url_is_html_displayed (lua_State *L)
+{
+ struct rspamd_lua_url *url = lua_check_url (L, 1);
+
+ if (url != NULL) {
+ lua_pushboolean (L, url->url->flags & RSPAMD_URL_FLAG_HTML_DISPLAYED);
+ }
+ else {
+ lua_pushnil (L);
+ }
+
+ return 1;
+}
+
/***
* @method url:get_tag(tag)
* Returns list of string for a specific tagname for an url