Browse Source

parser: support multiple dc:creator elements (returns as comma-separated list)

Andrew Dolgov 1 year ago
parent
commit
aa40a268f0
1 changed files with 6 additions and 3 deletions
  1. 6 3
      classes/feeditem/common.php

+ 6 - 3
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() {