Skip to content

Commit 68e5666

Browse files
authored
Encode special characters in list.label.label callback (#170)
1 parent c67d493 commit 68e5666

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/EventListener/DataContainer/LeadLabelListener.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ public function __invoke(array $row, string $label): string
6868
}
6969

7070
if ($this->stringParser) {
71-
return $this->stringParser->recursiveReplaceTokensAndTags($lead['leadLabel'], $tokens);
71+
$return = $this->stringParser->recursiveReplaceTokensAndTags($lead['leadLabel'], $tokens);
72+
} else {
73+
$return = \Haste\Util\StringUtil::recursiveReplaceTokensAndTags($lead['leadLabel'], $tokens);
7274
}
7375

74-
return \Haste\Util\StringUtil::recursiveReplaceTokensAndTags($lead['leadLabel'], $tokens);
76+
// Encode specialchars for the back end view (see terminal42/contao-leads#170)
77+
return StringUtil::specialchars($return);
7578
}
7679

7780
private function formatToken(string $title, int|string $value): string

0 commit comments

Comments
 (0)