[TYPO3-core] RFC #12466: PHP-5.3 Warning: strlen() expects parameter 1 to be string

Rupert Germann rupi at gmx.li
Wed Nov 4 20:22:51 CET 2009


Hi,

this is a SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=12466

Branches: Trunk

Problem:
When running TYPO3 4.3 under PHP 5.3 the error_log is filled with 
messages like this:
PHP Warning: strlen() expects parameter 1 to be string, array given in 
C:\xampp\xampp\htdocs\typo3\dummy-4.2.9\typo3\classes\class.typo3ajax.php 
line 119
reason for this is that json encoded content is handled as array and not 
as string.

Solution:
use empty() to find out if $content is an empty array or empty string


Info: PHP 5.2 doesn't throw a warning in this case.


greets
rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 12466.diff
Type: text/x-diff
Size: 629 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091104/4cfb72c2/attachment.diff>


More information about the TYPO3-team-core mailing list