Project

General

Profile

Actions

Bug #17389

closed

strtolower and strtoupper in evaluation of 'input'-type values nonsense when using UTF-8 enabled backend

Added by Norbert Bernhardt over 17 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-06-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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);
  1. $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);
  2. $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)


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #17272: 'lower' TCA specification may fail with non-ascii charactersClosedDmitry Dulepov2007-05-02

Actions
Actions #1

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)?

Actions #2

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF