diff options
author | corvid <devnull@localhost> | 2015-04-27 15:32:54 +0000 |
---|---|---|
committer | corvid <devnull@localhost> | 2015-04-27 15:32:54 +0000 |
commit | c7298e589b9065919761676b1606d17d372d18e3 (patch) | |
tree | 65489211c372c20a9c76ba0b7dfa1c2be3904f5f /src/html.cc | |
parent | f105d0398e5be19451d51e2ab72d8c9f1248f146 (diff) |
html5 permits relative BASE url
Diffstat (limited to 'src/html.cc')
-rw-r--r-- | src/html.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc index 61c216fa..e2bc6bf8 100644 --- a/src/html.cc +++ b/src/html.cc @@ -3396,8 +3396,13 @@ static void Html_tag_open_base(DilloHtml *html, const char *tag, int tagsize) if (html->InFlags & IN_HEAD) { if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "href"))) { - BaseUrl = a_Html_url_new(html, attrbuf, "", 1); - if (URL_SCHEME_(BaseUrl)) { + bool_t html5 = html->DocType == DT_HTML && + html->DocTypeVersion >= 5.0f; + + BaseUrl = html5 ? a_Html_url_new(html, attrbuf, NULL, 0) : + a_Html_url_new(html, attrbuf, "", 1); + + if (html5 || URL_SCHEME_(BaseUrl)) { /* Pass the URL_SpamSafe flag to the new base url */ a_Url_set_flags( BaseUrl, URL_FLAGS(html->base_url) & URL_SpamSafe); |