1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 11:45:56 +00:00

parser: trim some some feed-extracted data link titles and links

This commit is contained in:
Andrew Dolgov
2014-03-04 16:38:04 +04:00
parent 4ce778677e
commit 31bd6f7643
3 changed files with 17 additions and 13 deletions

View File

@@ -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;