]> git.wh0rd.org - tt-rss.git/commitdiff
Handle potentially-relative base element when getting favicon.
authorwn_ <invalid@email.com>
Sun, 1 Oct 2017 19:25:12 +0000 (14:25 -0500)
committerwn_ <invalid@email.com>
Sun, 1 Oct 2017 19:25:12 +0000 (14:25 -0500)
The base element's "href" attribute is not required to be absolute,
so rewrite relative to the site URL if it is relative.

See:
* https://www.w3.org/TR/html51/document-metadata.html#the-base-element
* https://html.spec.whatwg.org/multipage/semantics.html#the-base-element

include/functions.php

index 8ea8719cad59ce72582958263287fb4033005075..71a6be2e987c5c5579acfce7bfa2726902a23092 100644 (file)
 
                        $base = $xpath->query('/html/head/base');
                        foreach ($base as $b) {
-                               $url = $b->getAttribute("href");
+                               $url = rewrite_relative_url($url, $b->getAttribute("href"));
                                break;
                        }