]> git.wh0rd.org - tt-rss.git/commitdiff
calculating base locally
authorsyrnon <syrnon@outlook.com>
Tue, 9 Jul 2013 14:29:25 +0000 (17:29 +0300)
committersyrnon <syrnon@outlook.com>
Tue, 9 Jul 2013 14:29:25 +0000 (17:29 +0300)
classes/feeditem/atom.php

index c58d2a5ff43f586f8ce21a565936bcc8a32da965..522ca633e35d76f521e4f0e53c46cb060d09041a 100644 (file)
@@ -1,13 +1,6 @@
 <?php
 class FeedItem_Atom extends FeedItem_Common {
 
-        private $baseUrl;
-
-        function __construct($elem, $doc, $xpath, $baseUrl) {
-               parent::__construct($elem, $doc, $xpath);
-               $this->baseUrl= $baseUrl;
-        }
-
        function get_id() {
                $id = $this->elem->getElementsByTagName("id")->item(0);
 
@@ -46,8 +39,8 @@ class FeedItem_Atom extends FeedItem_Common {
                                (!$link->hasAttribute("rel")
                                        || $link->getAttribute("rel") == "alternate"
                                        || $link->getAttribute("rel") == "standout")) {
-
-                               return $this->baseUrl.$link->getAttribute("href");
+                               $base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)",$link);
+                               return $base.$link->getAttribute("href");
                        }
                }
        }