Project

General

Profile

Actions

Bug #23508

closed

PHP Warning in Template module: mb_strlen() expects parameter 1 to be string, array given

Added by Steffen Gebert about 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-09-06
Due date:
% Done:

0%

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

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

templateModulRootPage.png (70.3 KB) templateModulRootPage.png Administrator Admin, 2010-09-06 08:45
15648.diff (761 Bytes) 15648.diff Administrator Admin, 2010-09-06 10:10

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #23113: Enhancement of t3lib_div::testIntClosedSteffen Kamper2010-07-06

Actions
Is duplicate of TYPO3 Core - Bug #23525: Enhancement of t3lib_div::testInt introduced a different behaviourClosedErnesto Baschny2010-09-11

Actions
Actions #1

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.

Actions #2

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

Actions #3

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.

Actions #4

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.

Actions #5

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.

Actions #7

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF