]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Try harder to find urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Aug 2017 07:20:34 +0000 (08:20 +0100)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 28 Aug 2017 11:08:00 +0000 (13:08 +0200)
src/libserver/url.c

index 8e0cb52eecb1f50c5b7c00702f2eb2dba60b500a..d359a9984e6fba92e3386374fb817a19d2c1909b 100644 (file)
@@ -1895,8 +1895,10 @@ url_web_start (struct url_callback_data *cb,
                (g_ascii_strncasecmp (pos, "www", 3) == 0 ||
                 g_ascii_strncasecmp (pos, "ftp", 3) == 0)) {
 
-               if (!is_url_start (*(pos - 1)) && !g_ascii_isspace (*(pos - 1)) &&
-                               pos - 1 != match->prev_newline_pos) {
+               if (!(is_url_start (*(pos - 1)) ||
+                               g_ascii_isspace (*(pos - 1)) ||
+                               pos - 1 == match->prev_newline_pos ||
+                               (*(pos - 1) & 0x80))) { /* Chinese trick */
                        return FALSE;
                }
        }