[RSS Feed/News] Minor: \XF\Str\Formatter::wholeWordTrimAroundTerm length calculation bug with Turkish

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
The following line exists in wholeWordTrimAroundTerm:
PHP:

$termPosition = utf8_strpos(utf8_strtolower($string), utf8_strtolower($term));
However, changing the case of a string isn't guaranteed to preserve the length in many languages. A popular example is German, where ß has historically had no uppercase equivalent, so it's commonly converted to SS:
Code:

Code:
php > $s = 'ß';
php > echo mb_strlen($s);
1
php > echo mb_strlen(mb_strtoupper($s));
2
php > echo...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom