aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libserver/html/html.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index ef7fb35ba..e4cc137b4 100644
--- a/src/libserver/html/html.cxx
+++ b/src/libserver/html/html.cxx
@@ -1413,19 +1413,23 @@ html_process_input(rspamd_mempool_t *pool,
/*
* Base is allowed only within head tag but HTML is retarded
*/
- if (hc->base_url == NULL) {
- auto maybe_url = html_process_url_tag(pool, cur_tag, hc);
+ auto maybe_url = html_process_url_tag(pool, cur_tag, hc);
+
+ if (maybe_url) {
+ msg_debug_html ("got valid base tag");
+ cur_tag->extra = maybe_url.value();
+ cur_tag->flags |= FL_HREF;
- if (maybe_url) {
- msg_debug_html ("got valid base tag");
+ if (hc->base_url == nullptr) {
hc->base_url = maybe_url.value();
- cur_tag->extra = maybe_url.value();
- cur_tag->flags |= FL_HREF;
}
else {
- msg_debug_html ("got invalid base tag!");
+ msg_debug_html ("ignore redundant base tag");
}
}
+ else {
+ msg_debug_html ("got invalid base tag!");
+ }
}
if (cur_tag->id == Tag_IMG) {