Skip to content

Commit 5df9dea

Browse files
kitzbergerdkd-kaehm
authored andcommitted
[BUGFIX] Unicode characters vs. statistics feature
In case someone enters multi-byte characters into the search truncating that string requires mb_substr() instead of substr(). Resolves: #4072
1 parent b788000 commit 5df9dea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Domain/Search/Statistics/StatisticsWriterProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function getProcessedKeywords(
107107
$keywords = $query->getQuery();
108108
$keywords = $this->sanitizeString($keywords);
109109
// Ensure string does not exceed database field length
110-
$keywords = substr($keywords, 0, 128);
110+
$keywords = mb_substr($keywords, 0, 128, 'UTF-8');
111111
if ($lowerCaseQuery) {
112112
$keywords = mb_strtolower($keywords);
113113
}

0 commit comments

Comments
 (0)