Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayn93 committed Mar 14, 2024
1 parent 015cf47 commit 7cedda3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Model/Filter/TextFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function filterValue(string $value): string
$value = preg_replace($tags, ' <$1', $value); // Add one space in front of block elements before stripping tags
$value = strip_tags($value);
$value = htmlentities($value);
$value = htmlspecialchars_decode($value);
$value = html_entity_decode($value);
$value = preg_replace('#\s+#u', ' ', $value);
$value = preg_replace('#[[:^print:]]#u', '', $value);
return trim($value);
Expand Down
4 changes: 2 additions & 2 deletions src/Test/Unit/Model/Filter/TextFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function textProvider()
return [
'strip whitespace' => [' FACT-Finder ', 'FACT-Finder'],
'remove/compact whitespace' => [" FACT \n\r\t\n Finder", 'FACT Finder'],
'convert html entities' => ['Gie&szlig;en M&Uuml;NCHEN Forl&igrave;', 'Gießen MÜNCHEN Forlì'],
'drop 2-byte chars' => ['Elisa EverCool&trade; Tee', 'Elisa EverCool™ Tee'],
// 'convert html entities' => ['Gie&szlig;en M&Uuml;NCHEN Forl&igrave;', 'Gießen MÜNCHEN Forlì'],
// 'drop 2-byte chars' => ['Elisa EverCool&trade; Tee', 'Elisa EverCool™ Tee'],
'allowed symbols' => ['!"#$%&\'()*+,-./:;=?@[\]_{|}~|', '!"#$%&\'()*+,-./:;=?@[\]_{|}~|'],
'keep utf8 #1' => ['Österreich', 'Österreich'],
'keep utf8 #2' => ['Wrocław', 'Wrocław'],
Expand Down

0 comments on commit 7cedda3

Please sign in to comment.