diff options
author | Andrew Dolgov <[email protected]> | 2021-11-15 08:26:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-11-15 08:26:02 +0300 |
commit | aa924d9ee7674cfe649d498ce3cbcdb093bca956 (patch) | |
tree | b110e547ade2d043bca294ecb5af4b96fba365b9 /classes/feedparser.php | |
parent | a92070da068f1c4be7a35c7f92a5905c1307335b (diff) |
deal with several DOMElement-related errors
Diffstat (limited to 'classes/feedparser.php')
-rw-r--r-- | classes/feedparser.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/classes/feedparser.php b/classes/feedparser.php index abf1545f8..dd58df941 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -65,10 +65,12 @@ class FeedParser { $this->xpath = $xpath; - $root = $xpath->query("(//atom03:feed|//atom:feed|//channel|//rdf:rdf|//rdf:RDF)"); + $root_list = $xpath->query("(//atom03:feed|//atom:feed|//channel|//rdf:rdf|//rdf:RDF)"); - if (!empty($root) && $root->length > 0) { - $root = $root->item(0); + if (!empty($root_list) && $root_list->length > 0) { + + /** @var DOMElement|false $root */ + $root = $root_list->item(0); if ($root) { switch (mb_strtolower($root->tagName)) { |