From: zaikos Date: Wed, 14 Jan 2015 21:13:39 +0000 (-0500) Subject: Reverts most of be60340. Implements a simplier solution using XPath to get the proper... X-Git-Tag: 16.3~383^2^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2b4853f515c2deeb9026387afd40d9158a5ccd0a;p=tt-rss.git Reverts most of be60340. Implements a simplier solution using XPath to get the proper title tag from a feed item. --- diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index 0e2b77ac..7b4c4fb0 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -51,14 +51,10 @@ class FeedItem_RSS extends FeedItem_Common { } function get_title() { - $titles = $this->elem->getElementsByTagName("title"); + $title = $this->xpath->query("title", $this->elem)->item(0); - foreach ($titles as $title) { - $nv = trim($title->nodeValue); - - if (!empty($nv)) { - return $nv; - } + if ($title) { + return trim($title->nodeValue); } }