]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Ignore data urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 14:55:50 +0000 (15:55 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 14:55:50 +0000 (15:55 +0100)
src/libserver/html.c

index e5e43aed68b1a5652e909638066b531010d6d1e6..7b570bdc4f4d3f42c34d7b381a97330fe55e07b1 100644 (file)
@@ -1582,9 +1582,13 @@ rspamd_html_process_url_tag (rspamd_mempool_t *pool, struct html_tag *tag,
                                gchar *buf;
                                gsize orig_len;
 
-                               if (rspamd_substring_search (start, len, "://", 3) == -1 &&
-                                       (len >= sizeof ("data:") &&
-                                        g_ascii_strncasecmp (start, "data:", sizeof ("data:") - 1) != 0)) {
+                               if (rspamd_substring_search (start, len, "://", 3) == -1) {
+
+                                       if (len >= sizeof ("data:") &&
+                                               g_ascii_strncasecmp (start, "data:", sizeof ("data:") - 1) == 0) {
+                                               /* Image data url, never insert as url */
+                                               return NULL;
+                                       }
 
                                        /* Assume relative url */