From: Vsevolod Stakhov Date: Mon, 13 May 2019 15:14:37 +0000 (+0100) Subject: [Minor] HTML: Allow to extract base url from the tag X-Git-Tag: 2.0~910 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a9e44f359321212ef5dc9d8273aca3accdc84bc1;p=rspamd.git [Minor] HTML: Allow to extract base url from the tag --- diff --git a/src/libserver/html.c b/src/libserver/html.c index ff3053de7..fcc6e5684 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -60,7 +60,7 @@ static struct html_tag_def tag_defs[] = { TAG_DEF(Tag_APPLET, "applet", (CM_OBJECT | CM_IMG | CM_INLINE | CM_PARAM)), TAG_DEF(Tag_AREA, "area", (CM_BLOCK | CM_EMPTY | FL_HREF)), TAG_DEF(Tag_B, "b", (CM_INLINE|FL_BLOCK)), - TAG_DEF(Tag_BASE, "base", (CM_HEAD | CM_EMPTY)), + TAG_DEF(Tag_BASE, "base", (CM_HEAD | CM_EMPTY | FL_HREF)), TAG_DEF(Tag_BASEFONT, "basefont", (CM_INLINE | CM_EMPTY)), TAG_DEF(Tag_BDO, "bdo", (CM_INLINE)), TAG_DEF(Tag_BIG, "big", (CM_INLINE)), @@ -3030,9 +3030,13 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc, prev_tag->id == Tag_HTML) { url = rspamd_html_process_url_tag (pool, cur_tag, hc); - if (url != NULL && hc->base_url == NULL) { - /* We have a base tag available */ - hc->base_url = url; + if (url != NULL) { + if (hc->base_url == NULL) { + /* We have a base tag available */ + hc->base_url = url; + } + + cur_tag->extra = url; } } }