Bug #17389
closedstrtolower and strtoupper in evaluation of 'input'-type values nonsense when using UTF-8 enabled backend
0%
Description
In file t3lib/class.t3lib_tcemain.php, function checkValue_input_Eval input such as username is converted to upper / lower case using strtoupper and stringtolower (lines 1955-1962 of file revision 2361 in svn).
If you use umlauts in usernames this sometimes leads the string to be cut-off - "jäger" becomes "j" in MySQL.
Right now, lines 1955-1962 look like:case 'upper':
$value = strtoupper($value);
- $value = strtr($value, '', ''); // WILL make trouble with other charsets than ISO-8859-1, so what do we do here? PHP-function which can handle this for other charsets? Currently the browsers JavaScript will fix it.
break;
case 'lower':
$value = strtolower($value); - $value = strtr($value, '', ''); // WILL make trouble with other charsets than ISO-8859-1, so what do we do here? PHP-function which can handle this for other charsets? Currently the browsers JavaScript will fix it.
break;
Since I use mbstring, I changed these lines to:
case 'upper':
$value = mb_strtoupper($value);
break;
case 'lower':
$value = mb_strtolower($value);
break;
And voilá, you can use chinese usernames. :)
I would switch to mbstring as a requirement for coming versions of Typo3, because this library obviously has many more commands to offer where UTF matters than its rivals iconv and recode, and as such it is much easier to maintain the Typo3 code. Other possibilities would be if switches all over the PHP code: is UTF enable? Is mbstring installed? What if the result is (1) and (0)? ...
(issue imported from #M5805)
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.