diff --git a/libraries/classes/BrowseForeigners.php b/libraries/classes/BrowseForeigners.php index c865588d30..302ca3d495 100644 --- a/libraries/classes/BrowseForeigners.php +++ b/libraries/classes/BrowseForeigners.php @@ -277,22 +277,15 @@ class BrowseForeigners private function getDescriptionAndTitle(string $description): array { if (mb_strlen($description) <= $this->limitChars) { - $description = htmlspecialchars( - $description - ); $descriptionTitle = ''; } else { - $descriptionTitle = htmlspecialchars( - $description - ); - $description = htmlspecialchars( - mb_substr( - $description, - 0, - $this->limitChars - ) - . '...' - ); + $descriptionTitle = $description; + $description = mb_substr( + $description, + 0, + $this->limitChars + ) + . '...'; } return [ diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index aeaf090385..7381d073da 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -18,6 +18,7 @@ class BrowseForeignersTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::defineVersionConstants(); parent::setTheme(); $GLOBALS['cfg']['LimitChars'] = 50; $GLOBALS['cfg']['MaxRows'] = 25; @@ -135,7 +136,7 @@ class BrowseForeignersTest extends AbstractTestCase $this->assertEquals( [ - 'foobar<baz', + 'foobarcallFunction( @@ -152,7 +153,7 @@ class BrowseForeignersTest extends AbstractTestCase $this->assertEquals( [ 'fooba...', - 'foobar<baz', + 'foobarcallFunction( $browseForeigners,