Skip to content

Commit 5f378de

Browse files
Added space replace for tab, horizontal tab and form feed
1 parent daf5bf0 commit 5f378de

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

eZ/Publish/Core/Search/Common/FieldValueMapper/StringMapper.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ public function map(Field $field)
5151
*/
5252
protected function convert($value)
5353
{
54-
// Remove non-printable characters (except LF and CR)
54+
// Replace tab, vertical tab, form-feed chars to single space.
55+
$value = preg_replace(
56+
'([\x09\x0B\x0C]+)',
57+
' ',
58+
(string)$value
59+
);
60+
61+
// Remove non-printable characters (except LF and CR).
5562
return preg_replace(
56-
'([\x00-\x09\x0B\x0C\x0E-\x1F]+)',
63+
'([\x00-\x08\x0E-\x1F]+)',
5764
'',
5865
(string)$value
5966
);

0 commit comments

Comments
 (0)