Skip to content

Commit

Permalink
Ensure keywords string does not exceed database field length
Browse files Browse the repository at this point in the history
The keywords field of the statistics database is only 128 characters
long. If a search keyword with more than 128 chars is used, the 
database insert fails if statistics are enabled.

Fixes: TYPO3-Solr#3321
Ports: TYPO3-Solr#3322
  • Loading branch information
sascha-egerer authored and dkd-kaehm committed Aug 26, 2022
1 parent 55830f2 commit 1875740
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected function getProcessedKeywords(
): string {
$keywords = $query->getQuery();
$keywords = $this->sanitizeString($keywords);
// Ensure string does not exceed database field length
$keywords = substr($keywords, 0, 128);
if ($lowerCaseQuery) {
$keywords = mb_strtolower($keywords);
}
Expand Down

0 comments on commit 1875740

Please sign in to comment.