[TYPO3-core] RFC: Bug #0006663: Unserialized objects not debugged properly
Francois Suter
fsuter at cobweb.ch
Thu Nov 29 09:53:09 CET 2007
REMINDER #3
> 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
Cobweb Development Sarl - http://www.cobweb.ch
More information about the TYPO3-team-core
mailing list