From aa40a268f0b11cf40a031d451e23f2ab1af333bb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 2 Aug 2019 06:22:42 +0300 Subject: parser: support multiple dc:creator elements (returns as comma-separated list) --- classes/feeditem/common.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/classes/feeditem/common.php b/classes/feeditem/common.php index de8d3aefa..3193ed273 100755 --- a/classes/feeditem/common.php +++ b/classes/feeditem/common.php @@ -41,11 +41,14 @@ abstract class FeedItem_Common extends FeedItem { return clean($author->nodeValue); } - $author = $this->xpath->query("dc:creator", $this->elem)->item(0); + $author_elems = $this->xpath->query("dc:creator", $this->elem); + $authors = []; - if ($author) { - return clean($author->nodeValue); + foreach ($author_elems as $author) { + array_push($authors, clean($author->nodeValue)); } + + return implode(", ", $authors); } function get_comments_url() { -- cgit v1.2.3