aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:37:21 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:37:21 +0100
commit2e6f1ebd706f3e9023babcc19b69f838b5eff2a8 (patch)
treefe6e82e6415939dacf5bcb80fa71651832737fd0 /src
parente966950fb945eb2c5463dfcaa1fb197753003338 (diff)
downloadrspamd-2e6f1ebd706f3e9023babcc19b69f838b5eff2a8.tar.gz
rspamd-2e6f1ebd706f3e9023babcc19b69f838b5eff2a8.zip
[Minor] Store multiple base tags (but use only first one as usually)
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) {