diff options
author | Andrew Dolgov <[email protected]> | 2019-08-02 06:22:42 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-02 06:22:42 +0300 |
commit | aa40a268f0b11cf40a031d451e23f2ab1af333bb (patch) | |
tree | 732f28e2069fec088a98706b05ea542baa45a7d3 | |
parent | 4edfb526e112aab29214655804ce24215c87c4bd (diff) |
parser: support multiple dc:creator elements (returns as comma-separated list)
-rwxr-xr-x | classes/feeditem/common.php | 9 |
1 files 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() { |