]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] One more fix in the ZW spaces urls processing logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 May 2021 20:23:18 +0000 (21:23 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 May 2021 20:23:18 +0000 (21:23 +0100)
src/libserver/html.c
src/libserver/url.c

index c373bb115c9bbecc3c9d59c813121d5fe54a9852..ec46f30c1d6df0c16dd01515e3b6557eea43b143 100644 (file)
@@ -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
index 01973a75a6ed10687428ec7d453db0b27c6011b5..726f9b7f8f3694a9273319395a3134bbc034d197 100644 (file)
@@ -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)) {