Bug #23508
closedPHP Warning in Template module: mb_strlen() expects parameter 1 to be string, array given
0%
Description
When you open the template module and the overview over your pages and templates is shown (and you're using mbstring), the following warning is outputted:
PHP Warning: mb_stlen() expects parameter 1 to be string, array given in /.../t3lib/class.t3lib_cs.php line 1478
Also see the last three pages called "Array"
Occured on trunk, maybe also in older versions.
(issue imported from #M15648)
Files
Updated by Sven Juergens about 14 years ago
I had the same error message, but can't reproduce it in a new TYPO3 installation.
Please try out the attached patch.
Updated by Steffen Gebert about 14 years ago
Sven, can you guess, what causes this bug? I currently can't reproduce it, only documented it here, after SteffenR asked me this morning and I already saw this bug several times (IIRC even yesterday evening.. )
Updated by Sven Juergens about 14 years ago
the problem comes from sysext/tstemplate/ts/index.php in function renderList.
This function goes through an multidimensional Array, and call themself in every dimension and make some checks on the structure of the array, because there are differnet array keys for example "2" "2_" and "2."
then there is an If-else with the "problematic" Code
if (isset($pArray[$k . "_"])) {
...
}else{
...
here $pArray[$k] sould be only a string. ...
//then is called
t3lib_div::fixed_lgd_cs($pArray[$k], 30)
this produce the error, because $pArray[$k] is an array
}
my Problem is, i can't reproduce why the $pArray is in this TYPO3 version different.
Updated by Steffen Gebert about 14 years ago
Yes.. I'm interested in when isset($pArray[$k . "_"]) returns FALSE and thus the else branch is entered.
Updated by Sven Juergens about 14 years ago
found the problem here,
the function is working as aspected, but t3lib_div::testInt give back a wrong result!
There are three types of arrayKeys in $pArray "2", "2." and "2_"
with t3lib_div::testInt($k) the arrayKey is checked, here t3lib_div::testInt('2.') give back a TRUE!
and so the following isset($pArray[$k . "_"]) returns FALSE because there is no "2._"
Might be related to #23113.
Updated by Sven Juergens about 14 years ago
bug is resolved with http://bugs.typo3.org/view.php?id=15685