Issue Bug Closed

#14985Backend module List: TYPO3 Pages dumps PHP warnings, no array found

Florian Schaeffer 09/21/05, 14:13 updated 10/02/18, 12:33

Description

When using the backend module List: TYPO3 Pages I get some PHP warnings, stating that the value passed to the function formatCHash is not an array.

Line 299, 367, 387 the function is called:

$cHash = count(unserialize($row2[“cHashParams”])) ? $this->formatCHash(unserialize($row2[“cHashParams”])) : “”;

When using is_array instead of count the warning disappear.

Used versions:

TYPO3 3.8.0
Indexed Search 2.1.3
PHP 4.3.1
OS: SuSe Linux 9.1

I assume , there was a change in the way how count treats empty arrays or unserialize working on empty arrays.

I checkd some constellations and found out that:

Using an empty array makes no difference using count or is_array. If the values is stored as serialized array in MySQL there no problem either.

Only when using count on an NULL-value (so to say no Hash was ever generated or stored in the DB) the count returns 1. Is_array returns 0 so using is_array would be save in any case…
(issue imported from #M1473)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.