mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-12 11:31:00 +02:00
calculating base locally
This commit is contained in:
parent
f150f85a5e
commit
b28b2ce9eb
@ -1,13 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
class FeedItem_Atom extends FeedItem_Common {
|
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() {
|
function get_id() {
|
||||||
$id = $this->elem->getElementsByTagName("id")->item(0);
|
$id = $this->elem->getElementsByTagName("id")->item(0);
|
||||||
|
|
||||||
@ -46,8 +39,8 @@ class FeedItem_Atom extends FeedItem_Common {
|
|||||||
(!$link->hasAttribute("rel")
|
(!$link->hasAttribute("rel")
|
||||||
|| $link->getAttribute("rel") == "alternate"
|
|| $link->getAttribute("rel") == "alternate"
|
||||||
|| $link->getAttribute("rel") == "standout")) {
|
|| $link->getAttribute("rel") == "standout")) {
|
||||||
|
$base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)",$link);
|
||||||
return $this->baseUrl.$link->getAttribute("href");
|
return $base.$link->getAttribute("href");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user