Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10135 consider existance of htmlspecialchars_decode for publication title in text format #4366

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion lib/pkp
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