aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-05-13 21:23:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-05-13 21:23:18 +0100
commit7f8d761d3a998c5f7b9912a430e760fb93f25032 (patch)
tree937c527874f8f736b781d23d53e16fede1a7a249
parent869980fd240710636cc51bb8d085a354e8e18b12 (diff)
downloadrspamd-7f8d761d3a998c5f7b9912a430e760fb93f25032.tar.gz
rspamd-7f8d761d3a998c5f7b9912a430e760fb93f25032.zip
[Minor] One more fix in the ZW spaces urls processing logic
-rw-r--r--src/libserver/html.c11
-rw-r--r--src/libserver/url.c2
2 files changed, 3 insertions, 10 deletions
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)) {