aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/html/html.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/html/html.cxx')
-rw-r--r--src/libserver/html/html.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index 79120d109..4711a3caf 100644
--- a/src/libserver/html/html.cxx
+++ b/src/libserver/html/html.cxx
@@ -677,10 +677,17 @@ html_process_url_tag(rspamd_mempool_t *pool,
}
}
- auto url = html_process_url(pool, href_value);
+ auto url = html_process_url(pool, href_value).value_or(nullptr);
- if (url && std::holds_alternative<std::monostate>(tag->extra)) {
- tag->extra = url.value();
+ if (url) {
+ if (tag->id != Tag_A) {
+ /* Mark special tags special */
+ url->flags |= RSPAMD_URL_FLAG_SPECIAL;
+ }
+
+ if (std::holds_alternative<std::monostate>(tag->extra)) {
+ tag->extra = url;
+ }
}
return url;
@@ -949,7 +956,10 @@ html_process_img_tag(rspamd_mempool_t *pool,
}
hc->images.push_back(img);
- tag->extra = img;
+
+ if (std::holds_alternative<std::monostate>(tag->extra)) {
+ tag->extra = img;
+ }
}
static auto