Bug #15902

Calling PHP5-only iconv functions in PHP4

Added by Ernesto Baschny over 14 years ago. Updated about 14 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


A change in t3lib_cs that made it into RC2 (cvs diff -r 1.53 -r 1.54 t3lib/class.t3lib_cs.php) added some functions that are only available on PHP5 if the user chooses "iconv" (iconv_substr, iconv_strlen, iconv_strpos, iconv_strrpos). If using PHP4 with iconv support, I will get lots of errors:

Fatal error: Call to undefined function: iconv_strlen() in ....t3lib/class.t3lib_cs.php on line 1388

Attached patch checks if the functions are available before calling them.
(issue imported from #M2994)

iconv-php4-typo3-4rc2.diff View (2.15 KB) Administrator Admin, 2006-03-27 10:58


#1 Updated by Ernesto Baschny over 14 years ago

Hi Martin. I think this bug appeared by your iconv changes from some weeks ago.

#2 Updated by Martin Kutschker over 14 years ago

Ernesto, did you set SYS[t3lib_cs_utils] to "iconv"?

If so, please read the description again:
'String (values: "iconv" - PHP 5.0 only!'

#3 Updated by Ernesto Baschny over 14 years ago

Oh, no I haven't read that. In fact, I haven't even touched that configuration, because I upgraded from 3.8.x and it has always been like that ("iconv" for t3lib_cs_convMethod and t3lib_cs_utils). This wasn't documented like that on 3.8.x.

So I think the bug here consists of the fact that this setting is not backwards compatible. This has to be documented somewhere or a warning appear in the update wizard, if this is not already the case.

#4 Updated by Martin Kutschker over 14 years ago

You right, there is inconsistency here.

iconv was never used for t3lib_cs_utils although the docs said it was a valid option (3.8). And the docs said nothing about PHP5.

#5 Updated by Martin Kutschker over 14 years ago

iconv support for t3lib_cs_utils is disabled on PHP4 in config_default.php

Also available in: Atom PDF