Skip to content

Commit

Permalink
pkp/pkp-lib#9959 use createTextNode for article title and subtitle in…
Browse files Browse the repository at this point in the history
… order to escapt it (e.g. &) properly
  • Loading branch information
bozana committed May 22, 2024
1 parent b3f2990 commit 56a573f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions filter/ArticleCrossrefXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ public function createJournalArticleNode($doc, $submission)
$languageCounter = 1;
foreach ($titleLanguages as $lang) {
$titlesNode = $doc->createElementNS($deployment->getNamespace(), 'titles');
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', $publication->getLocalizedTitle($lang, 'html')));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title'));
$node->appendChild($doc->createTextNode($publication->getLocalizedTitle($lang, 'html')));
if ($subtitle = $publication->getLocalizedSubTitle($lang, 'html')) {
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'subtitle', $subtitle));
}
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'subtitle'));
$node->appendChild($doc->createTextNode($subtitle));
}
$journalArticleNode->appendChild($titlesNode);
$languageCounter++;
if ($languageCounter > 20) {
Expand All @@ -135,7 +137,7 @@ public function createJournalArticleNode($doc, $submission)
// contributors
$authors = $publication->getData('authors');

if (!empty($authors)) {
if ($authors->count() != 0) {
$contributorsNode = $doc->createElementNS($deployment->getNamespace(), 'contributors');

$isFirst = true;
Expand Down

0 comments on commit 56a573f

Please sign in to comment.