[TYPO3-core] RFC: Bug #0006663: Unserialized objects not debugged properly

Francois Suter fsuter at cobweb.ch
Tue Nov 6 23:30:21 CET 2007


This is an SVN patch request.

Type: Bugfix

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

Branches:
Trunk

Problem:
Unserialized objects with no class definition are not considered proper 
objects by PHP 5.2.x. t3lib_div::view_array() thus fails to catch them 
with the is_object() test. It then moves on to cast them to string, 
which causes a fatal error (as referenced previously in bug 
http://bugs.typo3.org/view.php?id=6529).

Solution:
Perform more precise tests to catch those special objects using 
gettype(). I know that gettype() usage is not recommended, but I 
couldn't find another workaround to that problem. A try/catch statement 
didn't work although PHP says it is a catchable error.

Notes:
I also added a test for the existence of the __toString() method so that 
it is used if available and did a minor code cleanup by replacing the 
while/each construct with a foreach loop.


Francois Suter

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug6663.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071106/a47845c2/attachment.txt 


More information about the TYPO3-team-core mailing list