diff --git a/filter/PreprintCrossrefXmlFilter.php b/filter/PreprintCrossrefXmlFilter.php index 2087ea908d..be3c344e44 100644 --- a/filter/PreprintCrossrefXmlFilter.php +++ b/filter/PreprintCrossrefXmlFilter.php @@ -176,7 +176,7 @@ public function createPostedContentNode($doc, $publication, $submission) $givenNames = $author->getGivenName(null); // Check if both givenName and familyName is set for the submission language. - if (isset($familyNames[$locale]) && isset($givenNames[$locale])) { + if (!empty($familyNames[$locale]) && !empty($givenNames[$locale])) { $personNameNode->setAttribute('language', LocaleConversion::getIso1FromLocale($locale)); $personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'given_name', htmlspecialchars(ucfirst($givenNames[$locale]), ENT_COMPAT, 'UTF-8'))); $personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($familyNames[$locale]), ENT_COMPAT, 'UTF-8'))); @@ -203,7 +203,7 @@ public function createPostedContentNode($doc, $publication, $submission) } } } else { - $personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($author->getFullName(false)), ENT_COMPAT, 'UTF-8'))); + $personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($givenNames[$locale]), ENT_COMPAT, 'UTF-8'))); } if ($author->getData('orcid')) {