diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-16 19:12:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-16 19:12:33 +0100 |
commit | e5bce79129c229b472afe7e76434186ca87273b2 (patch) | |
tree | 602189e09774e7c715a6b8f5b020753d99870a0c /src | |
parent | f47ea11325b853508e47ebdfbcbb1a1f047d907f (diff) | |
download | rspamd-e5bce79129c229b472afe7e76434186ca87273b2.tar.gz rspamd-e5bce79129c229b472afe7e76434186ca87273b2.zip |
Remove deprecated function.
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/html.c | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c index dbc3d20c6..18a71930f 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -850,124 +850,6 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool, } -static void -parse_tag_url (struct rspamd_task *task, - struct mime_text_part *part, - tag_id_t id, - gchar *tag_text, - gsize tag_len, - gsize remain) -{ - gchar *c = NULL, *p, *url_text; - gint len, rc; - struct rspamd_url *url; - gboolean got_single_quote = FALSE, got_double_quote = FALSE; - - /* For A tags search for href= and for IMG tags search for src= */ - if (id == Tag_A) { - c = rspamd_strncasestr (tag_text, "href=", tag_len); - len = sizeof ("href=") - 1; - } - else if (id == Tag_IMG) { - c = rspamd_strncasestr (tag_text, "src=", tag_len); - len = sizeof ("src=") - 1; - } - - if (c != NULL) { - /* First calculate length */ - c += len; - /* Skip spaces after eqsign */ - while (g_ascii_isspace (*c)) { - c++; - } - len = 0; - p = c; - while (*p && (guint)(p - tag_text) < tag_len) { - if (got_double_quote) { - if (*p == '"') { - break; - } - else { - len++; - } - } - else if (got_single_quote) { - if (*p == '\'') { - break; - } - else { - len++; - } - } - else if (g_ascii_isspace (*p) || *p == '>' || - (*p == '/' && *(p + 1) == '>') || *p == '\r' || *p == '\n') { - break; - } - else { - if (*p == '"' && !got_single_quote) { - got_double_quote = !got_double_quote; - } - else if (*p == '\'' && !got_double_quote) { - got_single_quote = !got_single_quote; - } - else { - len++; - } - } - p++; - } - - if (got_single_quote || got_double_quote) { - c++; - } - - if (len == 0) { - return; - } - - url_text = rspamd_mempool_alloc (task->task_pool, len + 1); - rspamd_strlcpy (url_text, c, len + 1); - len = rspamd_html_decode_entitles_inplace (url_text, len); - - if (g_ascii_strncasecmp (url_text, "http", - sizeof ("http") - 1) != 0 && - g_ascii_strncasecmp (url_text, "www", - sizeof ("www") - 1) != 0 && - g_ascii_strncasecmp (url_text, "ftp://", - sizeof ("ftp://") - 1) != 0 && - g_ascii_strncasecmp (url_text, "mailto:", - sizeof ("mailto:") - 1) != 0) { - - return; - } - - url = rspamd_mempool_alloc (task->task_pool, sizeof (struct rspamd_url)); - rc = rspamd_url_parse (url, url_text, len, task->task_pool); - - if (rc == URI_ERRNO_OK && url->hostlen != 0) { - /* - * Check for phishing - */ - if ((p = strchr (c, '>')) != NULL && id == Tag_A) { - p++; - check_phishing (task, url, p, remain - (p - tag_text), id); - } - if (url->protocol == PROTOCOL_MAILTO) { - if (url->userlen > 0) { - if (!g_hash_table_lookup (task->emails, url)) { - g_hash_table_insert (task->emails, url, url); - } - } - } - else { - if (!g_hash_table_lookup (task->urls, url)) { - g_hash_table_insert (task->urls, url, url); - } - } - } - } -} - static gboolean rspamd_html_process_tag (rspamd_mempool_t *pool, struct html_content *hc, struct html_tag *tag, GNode **cur_level, gboolean *balanced) |