af_redditimgur: absolutize links before working on them (again)
This commit is contained in:
parent
e507d006fd
commit
cbf710161d
|
@ -653,10 +653,14 @@ class Af_RedditImgur extends Plugin {
|
||||||
/** @var ?DOMElement $content_link */
|
/** @var ?DOMElement $content_link */
|
||||||
$content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0);
|
$content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0);
|
||||||
|
|
||||||
|
if ($content_link) {
|
||||||
|
$content_href = UrlHelper::rewrite_relative($article["link"], $content_link->getAttribute("href"), "a");
|
||||||
|
|
||||||
|
if ($this->is_blacklisted($content_href))
|
||||||
|
return $article;
|
||||||
|
|
||||||
if ($this->host->get($this, "enable_content_dupcheck")) {
|
if ($this->host->get($this, "enable_content_dupcheck")) {
|
||||||
|
|
||||||
if ($content_link) {
|
|
||||||
$content_href = $content_link->getAttribute("href");
|
|
||||||
$entry_guid = $article["guid_hashed"];
|
$entry_guid = $article["guid_hashed"];
|
||||||
$owner_uid = $article["owner_uid"];
|
$owner_uid = $article["owner_uid"];
|
||||||
|
|
||||||
|
@ -682,20 +686,16 @@ class Af_RedditImgur extends Plugin {
|
||||||
if ($num_found > 0) $article["force_catchup"] = true;
|
if ($num_found > 0) $article["force_catchup"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($content_link && $this->is_blacklisted($content_link->getAttribute("href")))
|
|
||||||
return $article;
|
|
||||||
|
|
||||||
$found = $this->inline_stuff($article, $doc, $xpath);
|
$found = $this->inline_stuff($article, $doc, $xpath);
|
||||||
|
|
||||||
$node = $doc->getElementsByTagName('body')->item(0);
|
$node = $doc->getElementsByTagName('body')->item(0);
|
||||||
|
|
||||||
if ($node && $found) {
|
if ($node && $found) {
|
||||||
$article["content"] = $doc->saveHTML($node);
|
$article["content"] = $doc->saveHTML($node);
|
||||||
$article["enclosures"] = $this->generated_enclosures;
|
$article["enclosures"] = $this->generated_enclosures;
|
||||||
} else if ($content_link) {
|
} else {
|
||||||
$article = $this->readability($article, $content_link->getAttribute("href"), $doc, $xpath);
|
$article = $this->readability($article, $content_href, $doc, $xpath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue