]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix processing of embedded urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Apr 2019 08:38:41 +0000 (09:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Apr 2019 08:38:41 +0000 (09:38 +0100)
src/libserver/html.c

index 41925609e9d8b3399584f28a525c33c5dc7a26ad..cc74d676e1c143091078e50b40f0d54e8c212c47 100644 (file)
@@ -1706,19 +1706,21 @@ rspamd_html_process_img_tag (rspamd_mempool_t *pool, struct html_tag *tag,
                                /* We have an embedded image */
                                img->flags |= RSPAMD_HTML_FLAG_IMAGE_EMBEDDED;
                        }
-                       if (comp->len > sizeof ("data:") - 1 && memcmp (comp->start,
-                                       "data:", sizeof ("data:") - 1) == 0) {
-                               /* We have an embedded image in HTML tag */
-                               img->flags |=
-                                               (RSPAMD_HTML_FLAG_IMAGE_EMBEDDED|RSPAMD_HTML_FLAG_IMAGE_DATA);
-                               rspamd_html_process_data_image (pool, img, comp);
-                               hc->flags |= RSPAMD_HTML_FLAG_HAS_DATA_URLS;
-                       }
                        else {
-                               img->flags |= RSPAMD_HTML_FLAG_IMAGE_EXTERNAL;
-                               if (img->src) {
-                                       img->url = rspamd_html_process_url (pool,
-                                                       img->src, fstr.len, NULL);
+                               if (comp->len > sizeof ("data:") - 1 && memcmp (comp->start,
+                                               "data:", sizeof ("data:") - 1) == 0) {
+                                       /* We have an embedded image in HTML tag */
+                                       img->flags |=
+                                                       (RSPAMD_HTML_FLAG_IMAGE_EMBEDDED | RSPAMD_HTML_FLAG_IMAGE_DATA);
+                                       rspamd_html_process_data_image (pool, img, comp);
+                                       hc->flags |= RSPAMD_HTML_FLAG_HAS_DATA_URLS;
+                               }
+                               else {
+                                       img->flags |= RSPAMD_HTML_FLAG_IMAGE_EXTERNAL;
+                                       if (img->src) {
+                                               img->url = rspamd_html_process_url (pool,
+                                                               img->src, fstr.len, NULL);
+                                       }
                                }
                        }
                }