summaryrefslogtreecommitdiff
path: root/classes/feeditem
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-01-19 21:40:20 +0300
committerAndrew Dolgov <[email protected]>2015-01-19 21:40:20 +0300
commit206326c219a08b91a793cec9f1798f0f69f7950d (patch)
tree4fecf6f768bb2657fe0275e2baaf5fa86bdbd718 /classes/feeditem
parent94238b143a031d731341e1e344e7032f19f397ca (diff)
feedparser: xpath doesn't properly query for title element if there's a default namespace so let's add a separate ugly hack for rdf:RDF feeds, thanks for that xml dipshits
Diffstat (limited to 'classes/feeditem')
-rw-r--r--classes/feeditem/rss.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php
index 7b4c4fb0c..27a364b81 100644
--- a/classes/feeditem/rss.php
+++ b/classes/feeditem/rss.php
@@ -56,6 +56,14 @@ class FeedItem_RSS extends FeedItem_Common {
if ($title) {
return trim($title->nodeValue);
}
+
+ // if the document has a default namespace then querying for
+ // title would fail because of reasons so let's try the old way
+ $title = $this->elem->getElementsByTagName("title")->item(0);
+
+ if ($title) {
+ return trim($title->nodeValue);
+ }
}
function get_content() {