Skip to content

Commit

Permalink
pkp#10135 add htmlspecialchars_decode for publication title and subti…
Browse files Browse the repository at this point in the history
…tle in text format
  • Loading branch information
bozana committed Jun 27, 2024
1 parent ad8370a commit 9d24612
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/publication/PKPPublication.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
use PKP\userGroup\UserGroup;

class PKPPublication extends \PKP\core\DataObject
{
{
/**
* Get the default/fall back locale the values should exist for
*/
public function getDefaultLocale(): ?string
public function getDefaultLocale(): ?string
{
return $this->getData('locale');
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public function getLocalizedTitle($preferredLocale = null, string $format = 'tex
break;
case 'text':
// Title is in HTML, prefix is already in text. Convert title.
$title = strip_tags($title);
$title = htmlspecialchars_decode(strip_tags($title));
break;
default: throw new \Exception('Invalid format!');
}
Expand All @@ -123,7 +123,7 @@ public function getLocalizedSubTitle($preferredLocale = null, string $format = '
$subTitle = $this->getLocalizedData('subtitle', $preferredLocale);

if ($subTitle) {
return strtolower($format) === 'text' ? strip_tags($subTitle) : $subTitle;
return strtolower($format) === 'text' ? htmlspecialchars_decode(strip_tags($subTitle)) : $subTitle;
}

return '';
Expand Down

0 comments on commit 9d24612

Please sign in to comment.