Skip to content

Commit

Permalink
[BUGFIX] Respect multi-byte values in search sword
Browse files Browse the repository at this point in the history
Resolves: #84857
Releases: master, 8.7
Change-Id: I72563fad6233f0508273f6a75b2f7ab51894e501
Reviewed-on: https://review.typo3.org/56795
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
  • Loading branch information
bmack authored and tmotyl committed Apr 25, 2018
1 parent b18fe24 commit d1a3cfb
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -905,9 +905,8 @@ protected function writeSearchStat($searchParams, $searchWords, $count, $pt)
*/
protected function getSearchWords($defaultOperator)
{
// Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind,
// shortening the string here is only a run-away feature!)
$searchWords = substr($this->getSword(), 0, 200);
// Shorten search-word string to max 200 bytes - shortening the string here is only a run-away feature!
$searchWords = mb_substr($this->getSword(), 0, 200);
// Convert to UTF-8 + conv. entities (was also converted during indexing!)
if ($GLOBALS['TSFE']->metaCharset && $GLOBALS['TSFE']->metaCharset !== 'utf-8') {
$searchWords = mb_convert_encoding($searchWords, 'utf-8', $GLOBALS['TSFE']->metaCharset);
Expand Down

0 comments on commit d1a3cfb

Please sign in to comment.