Remove duplicate HTML escaping on foreign keys modal
Only twig needs this data and will escape it Also fixed the test as it could not run by itself because of missing version constants for setTheme Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
436e0da185
commit
b1eed641ef
@ -277,22 +277,15 @@ class BrowseForeigners
|
|||||||
private function getDescriptionAndTitle(string $description): array
|
private function getDescriptionAndTitle(string $description): array
|
||||||
{
|
{
|
||||||
if (mb_strlen($description) <= $this->limitChars) {
|
if (mb_strlen($description) <= $this->limitChars) {
|
||||||
$description = htmlspecialchars(
|
|
||||||
$description
|
|
||||||
);
|
|
||||||
$descriptionTitle = '';
|
$descriptionTitle = '';
|
||||||
} else {
|
} else {
|
||||||
$descriptionTitle = htmlspecialchars(
|
$descriptionTitle = $description;
|
||||||
$description
|
$description = mb_substr(
|
||||||
);
|
|
||||||
$description = htmlspecialchars(
|
|
||||||
mb_substr(
|
|
||||||
$description,
|
$description,
|
||||||
0,
|
0,
|
||||||
$this->limitChars
|
$this->limitChars
|
||||||
)
|
)
|
||||||
. '...'
|
. '...';
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class BrowseForeignersTest extends AbstractTestCase
|
|||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
parent::defineVersionConstants();
|
||||||
parent::setTheme();
|
parent::setTheme();
|
||||||
$GLOBALS['cfg']['LimitChars'] = 50;
|
$GLOBALS['cfg']['LimitChars'] = 50;
|
||||||
$GLOBALS['cfg']['MaxRows'] = 25;
|
$GLOBALS['cfg']['MaxRows'] = 25;
|
||||||
@ -135,7 +136,7 @@ class BrowseForeignersTest extends AbstractTestCase
|
|||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
[
|
[
|
||||||
'foobar<baz',
|
'foobar<baz',
|
||||||
'',
|
'',
|
||||||
],
|
],
|
||||||
$this->callFunction(
|
$this->callFunction(
|
||||||
@ -152,7 +153,7 @@ class BrowseForeignersTest extends AbstractTestCase
|
|||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
[
|
[
|
||||||
'fooba...',
|
'fooba...',
|
||||||
'foobar<baz',
|
'foobar<baz',
|
||||||
],
|
],
|
||||||
$this->callFunction(
|
$this->callFunction(
|
||||||
$browseForeigners,
|
$browseForeigners,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user