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 28, 2024
1 parent 96fab5b commit 223dab6
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 223dab6

Please sign in to comment.