Issue Bug Closed

#17169word spit incorrectly works with UTF-8 texts

Dimitriy Simakov 03/29/07, 16:19 updated 09/06/13, 09:07

Description

Some letters in utf-8 texts are cut, when displayed in search results. This can be fixed by adding ‘u’ modifier to preg_replace call in function markupSWpartsOfString:
$str = preg_replace(‘/\s\s+/u’,’ ‘,$str);

However, this is not considered as final solution. Probably it’s better to use mb_ereg_replace instead of preg_replace

—- class.tx_indexedsearch.php.old Thu Mar 29 18:16:10 2007
+++ class.tx_indexedsearch.php Thu Mar 29 18:15:58 2007
@@ -1966,7 +1966,7

// Init:
$str = str_replace(‘ ’,’ ‘,t3lib_parsehtml::bidir_htmlspecialchars($str,1));
$str = preg_replace(‘/\s\s+/’,’ ‘,$str);
+ $str = preg_replace(‘/\s\s+/u’,’ ‘,$str);
$swForReg = array();
// Prepare search words for regex:

(issue imported from #M5322)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.