From 99dfdbc10d9daa8059fd6c017b1580ad493aa8f6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 8 Jul 2018 11:29:05 +0200 Subject: Avoid feed credentials in logs (#1949) * Avoid feed credentials in logs Related to https://github.com/FreshRSS/FreshRSS/pull/1891 * Changelog 1949 --- app/Models/Feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Models/Feed.php') diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 89eb0a53c..0b5647261 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -59,8 +59,8 @@ class FreshRSS_Feed extends Minz_Model { return $this->hash; } - public function url() { - return $this->url; + public function url($includeCredentials = true) { + return $includeCredentials ? $this->url : SimplePie_Misc::url_remove_credentials($this->url); } public function selfUrl() { return $this->selfUrl; -- cgit v1.2.3 From 14e1b23e42b322b9c54475e4b69c1aa60c94e280 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 2 Sep 2018 13:36:46 +0200 Subject: Allow multiple authors (#1997) Fix https://github.com/FreshRSS/FreshRSS/issues/1968 --- app/Models/Feed.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app/Models/Feed.php') diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 0b5647261..ed381a867 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -341,7 +341,7 @@ class FreshRSS_Feed extends Minz_Model { foreach ($feed->get_items() as $item) { $title = html_only_entity_decode(strip_tags($item->get_title())); - $author = $item->get_author(); + $authors = $item->get_authors(); $link = $item->get_permalink(); $date = @strtotime($item->get_date()); @@ -409,12 +409,19 @@ class FreshRSS_Feed extends Minz_Model { $guid = $item->get_id(false, false); $hasUniqueGuids &= empty($guids['_' . $guid]); $guids['_' . $guid] = true; + $author_names = ''; + if (is_array($authors)) { + foreach ($authors as $author) { + $author_names .= html_only_entity_decode(strip_tags($author->name == '' ? $author->email : $author->name)) . ', '; + } + } + $author_names = substr($author_names, 0, -2); $entry = new FreshRSS_Entry( $this->id(), $guid, $title === null ? '' : $title, - $author === null ? '' : html_only_entity_decode(strip_tags($author->name == null ? $author->email : $author->name)), + $author_names, $content === null ? '' : $content, $link === null ? '' : $link, $date ? $date : time() -- cgit v1.2.3