summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwn_ <[email protected]>2024-05-08 23:59:25 +0000
committerwn_ <[email protected]>2024-05-09 00:00:51 +0000
commit7a5ea2a2b9ea9e1d9ff5134d626c9a0c4a905e0e (patch)
treed3f6c350921c7df7f9e57e5443a68bf0b6115df1
parentd832907125a7711397da8ade5cfb51082d802542 (diff)
Check 'head' and 'body' when searching HTML for feed links.
YouTube, for some reason, puts theirs in 'body'.
-rw-r--r--classes/Feeds.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/Feeds.php b/classes/Feeds.php
index 4d4ca3240..41351fbde 100644
--- a/classes/Feeds.php
+++ b/classes/Feeds.php
@@ -2097,8 +2097,8 @@ class Feeds extends Handler_Protected {
$doc = new DOMDocument();
if (@$doc->loadHTML($content)) {
$xpath = new DOMXPath($doc);
- $entries = $xpath->query('/html/head/link[@rel="alternate" and '.
- '(contains(@type,"rss") or contains(@type,"atom"))]|/html/head/link[@rel="feed"]');
+ $entries = $xpath->query('/html/*[self::head or self::body]/link[@rel="alternate" and '.
+ '(contains(@type,"rss") or contains(@type,"atom"))]|/html/*[self::head or self::body]/link[@rel="feed"]');
foreach ($entries as $entry) {
if ($entry->hasAttribute('href')) {