From 31bd6f7643bf139802a224f4584caca3cbbcc9b8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 4 Mar 2014 16:38:04 +0400 Subject: parser: trim some some feed-extracted data link titles and links --- classes/feedparser.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'classes/feedparser.php') diff --git a/classes/feedparser.php b/classes/feedparser.php index 187875b5f..239fdb7a6 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -205,6 +205,10 @@ class FeedParser { break; } + + if ($this->title) $this->title = trim($this->title); + if ($this->link) $this->link = trim($this->link); + } else { if( !isset($this->error) ){ $this->error = "Unknown/unsupported feed type"; @@ -252,7 +256,7 @@ class FeedParser { foreach ($links as $link) { if (!$rel || $link->hasAttribute('rel') && $link->getAttribute('rel') == $rel) { - array_push($rv, $link->getAttribute('href')); + array_push($rv, trim($link->getAttribute('href'))); } } break; @@ -261,7 +265,7 @@ class FeedParser { foreach ($links as $link) { if (!$rel || $link->hasAttribute('rel') && $link->getAttribute('rel') == $rel) { - array_push($rv, $link->getAttribute('href')); + array_push($rv, trim($link->getAttribute('href'))); } } break; -- cgit v1.2.3-54-g00ecf