]> git.wh0rd.org Git - tt-rss.git/commitdiff
Made FeedItem_RSS::get_title() more aggresive in finding an article title.
authorzaikos <no-reply@zaikos.com>
Wed, 14 Jan 2015 18:28:58 +0000 (13:28 -0500)
committerzaikos <no-reply@zaikos.com>
Wed, 14 Jan 2015 18:28:58 +0000 (13:28 -0500)
classes/feeditem/rss.php

index c9a7467cda6581b6d00ec788c08a64d5c7d6345e..0e2b77ac7cb26e79cb384d893a49021e9efef858 100644 (file)
@@ -51,10 +51,14 @@ class FeedItem_RSS extends FeedItem_Common {
        }
 
        function get_title() {
-               $title = $this->elem->getElementsByTagName("title")->item(0);
+               $titles = $this->elem->getElementsByTagName("title");
 
-               if ($title) {
-                       return trim($title->nodeValue);
+               foreach ($titles as $title) {
+                       $nv = trim($title->nodeValue);
+
+                       if (!empty($nv)) {
+                               return $nv;
+                       }
                }
        }