Skip to content

Commit

Permalink
Merge pull request #4344 from bozana/10135-3_4_0
Browse files Browse the repository at this point in the history
pkp/pkp-lib#10135 consider existance of htmlspecialchars_decode for publication title in text format
  • Loading branch information
bozana authored Jul 12, 2024
2 parents 187cdaf + 5601b5a commit df886e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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 @@ -1057,7 +1057,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 df886e8

Please sign in to comment.