Skip to content

Commit

Permalink
pkp/pkp-lib#10135 consider existance of htmlspecialchars_decode for p…
Browse files Browse the repository at this point in the history
…ublication title in text format
  • Loading branch information
bozana committed Jul 12, 2024
1 parent ef95e24 commit 098a0f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getCellActions($request, $row, $column, $position = GridHandler:
new RedirectAction(
Repo::submission()->getWorkflowUrlByUserRoles($submission)
),
htmlspecialchars($title)
$title
)
];
case 'issue':
Expand Down
9 changes: 5 additions & 4 deletions plugins/generic/datacite/filter/DataciteXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,15 @@ public function createTitlesNode($doc, $issue, $publication, $galley, $galleyFil
$titlesNode = $doc->createElementNS($deployment->getNamespace(), 'titles');
// Start with the primary object locale.
$primaryTitle = array_shift($titles);
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars(PKPString::html2text($primaryTitle), ENT_COMPAT, 'UTF-8')));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars($primaryTitle, ENT_COMPAT, 'UTF-8')));
// Then let the translated titles follow.
foreach ($titles as $locale => $title) {
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars(PKPString::html2text($title), ENT_COMPAT, 'UTF-8')));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars($title, ENT_COMPAT, 'UTF-8')));
$node->setAttribute('titleType', DATACITE_TITLETYPE_TRANSLATED);
}
// And finally the alternative title.
if (!empty($alternativeTitle)) {
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars(PKPString::html2text($alternativeTitle), ENT_COMPAT, 'UTF-8')));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title', htmlspecialchars($alternativeTitle, ENT_COMPAT, 'UTF-8')));
$node->setAttribute('titleType', DATACITE_TITLETYPE_ALTERNATIVE);
}
return $titlesNode;
Expand Down Expand Up @@ -1058,7 +1058,8 @@ public function getIssueToc($issue, $objectLocalePrecedence)
$toc = '';
foreach ($submissions as $submissionInIssue) { /** @var Submission $submissionInIssue */
$currentEntry = $this->getPrimaryTranslation(
$submissionInIssue->getCurrentPublication()?->getTitles() ?? [],
// get html format because later PKPString::html2text will be applied
$submissionInIssue->getCurrentPublication()?->getTitles('html') ?? [],
$objectLocalePrecedence
);
assert(!empty($currentEntry));
Expand Down

0 comments on commit 098a0f3

Please sign in to comment.