aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-02 13:36:46 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-02 13:36:46 +0200
commit14e1b23e42b322b9c54475e4b69c1aa60c94e280 (patch)
tree82a8af33bf7397d72c4f8198c72ca6592cbc02cb /app/Models
parent32d9c3b7905f4e43ffdf4bf2bf37723cfd18390c (diff)
Allow multiple authors (#1997)
Fix https://github.com/FreshRSS/FreshRSS/issues/1968
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Feed.php11
1 files changed, 9 insertions, 2 deletions
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()