[BUGFIX] Avoid autoloading of non-objects in DataMapper 49/25349/9
authorTomita Militaru <militarutomita@gmail.com>
Tue, 12 Nov 2013 23:37:50 +0000 (01:37 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Wed, 30 Jul 2014 09:14:33 +0000 (11:14 +0200)
commit3fa5989f3002080f136092ef0d07c0e208a5de3e
tree4b2016ceb1120ad04d533a4763a89d7d14bc3518
parente172269f8db8720083c1e74eca03d9662a331185
[BUGFIX] Avoid autoloading of non-objects in DataMapper

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.

Resolves: #53425
Releases: 6.3
Change-Id: I8b97499f2d90e26ba2a5dec411de266948fdf005
Reviewed-on: http://review.typo3.org/25349
Reviewed-by: Tobias Liebig <tobias.liebig@typo3.org>
Tested-by: Tobias Liebig <tobias.liebig@typo3.org>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php