Closed Coroico closed 11 years ago
See commit 52fee23 for the fix of this issue.
The fix provided is not relevant. When you have a text with multibyte characters and a text length < extract length, then you get a warning:
Warning: mb_strpos() [function.mb-strpos]: Offset not contained in string in ..../core/components/advsearch/model/advsearch/advsearch.class.php
The textlength returned by : $textLength = mb_strlen($text);
is the length with the default internal encoding (ascii). So If you have some multibyte characters, the text length provided > true length.
To fix it add mb_internal_encoding($this->config['charset']); at the beginning of the getExtract function and remove the use of $encoding inside multi-bytes function.
Warning: mb_strpos() [function.mb-strpos]: Offset not contained in string in ..../core/components/advsearch/model/advsearch/advsearch.class.php on line 702
This warning occurs inside the getExtracts() function inside the advSearch.class.php file:
The line 702 is: $pos = min(mb_strpos($text, ' ', $extractLength - 1, $encoding), mb_strpos($text, '.', $extractLength - 1, $encoding));