Review main Merged

25349[BUGFIX] Avoid autoloading of non-objects in DataMapper

Tomita Militaru CR +2 V +2 Easy +5 −3 updated 07/30/14, 09:14

Commit message

While persisting an object, the DataMapper is asked for the plain value
of a property, the TypeHandlingUtility::isCoreType() method is using
"is_subclass_of()" to check if the given input is an instance of 
\TYPO3\CMS\Core\Type\TypeInterface.
Unfortunately, when passing a string into "is_subclass_of" it tries to 
instantiate an object of that name. This will trigger the class autoloader.
Even worse, when the string contains a special char (like an umlaut) the
class cache will throw an exception (#1233057752). Thus persisting an object
with special chars in a property value is not possible at the moment.

This change fixes the issue by calling TypeHandlingUtility::isCoreType() only
if $input is an object.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1