From: Vsevolod Stakhov Date: Thu, 13 May 2021 20:23:18 +0000 (+0100) Subject: [Minor] One more fix in the ZW spaces urls processing logic X-Git-Tag: 3.0~406 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7f8d761d3a998c5f7b9912a430e760fb93f25032;p=rspamd.git [Minor] One more fix in the ZW spaces urls processing logic --- diff --git a/src/libserver/html.c b/src/libserver/html.c index c373bb115..ec46f30c1 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -2609,7 +2609,6 @@ rspamd_html_check_displayed_url (rspamd_mempool_t *pool, struct rspamd_url *turl; gboolean url_found = FALSE; struct rspamd_process_exception *ex; - enum rspamd_normalise_result norm_res; guint saved_flags = 0; gsize dlen; @@ -2625,14 +2624,6 @@ rspamd_html_check_displayed_url (rspamd_mempool_t *pool, url->visible_part = (gchar *)rspamd_string_len_strip (url->visible_part, &dlen, " \t\v\r\n"); - norm_res = rspamd_normalise_unicode_inplace (pool, url->visible_part, &dlen); - - if (norm_res & RSPAMD_UNICODE_NORM_UNNORMAL) { - saved_flags |= RSPAMD_URL_FLAG_UNNORMALISED; - } - if (norm_res & RSPAMD_UNICODE_NORM_ZERO_SPACES) { - saved_flags |= RSPAMD_URL_FLAG_ZW_SPACES; - } rspamd_html_url_is_phished (pool, url, url->visible_part, @@ -2678,6 +2669,8 @@ rspamd_html_check_displayed_url (rspamd_mempool_t *pool, /* Already inserted by `rspamd_url_set_add_or_return` */ } } + + rspamd_normalise_unicode_inplace (pool, url->visible_part, &dlen); } static gboolean diff --git a/src/libserver/url.c b/src/libserver/url.c index 01973a75a..726f9b7f8 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -1369,7 +1369,7 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, if (!u_isalnum (uc)) { /* Bad symbol */ if (IS_ZERO_WIDTH_SPACE (uc)) { - (*flags) |= RSPAMD_URL_FLAG_OBSCURED|RSPAMD_URL_FLAG_ZW_SPACES; + (*flags) |= RSPAMD_URL_FLAG_ZW_SPACES; } else { if (!u_isgraph (uc)) {