[BUGFIX] Don't access property if subject is scalar 86/28586/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 21 Mar 2014 07:19:48 +0000 (08:19 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 24 Mar 2014 16:36:16 +0000 (17:36 +0100)
Trying to access a property if the subject is
a string, causes the class loader to be triggered
as is_callable is invoked.

We can avoid that by checking if the subject
is an object or array. We can neglect that
is_scalar also returns false for resource types
as this will not really happen in practice.

Resolves: #56993
Releases: 6.2
Change-Id: I94754cd919acc857cd9a8b8e486080c0bf567112
Reviewed-on: https://review.typo3.org/28586
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Christian Weiske
Tested-by: Christian Weiske
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php

index d96ab35..d74a8e6 100644 (file)
@@ -94,7 +94,7 @@ class ObjectAccess {
         * @internal
         */
        static public function getPropertyInternal($subject, $propertyName, $forceDirectAccess, &$propertyExists) {
-               if ($subject === NULL) {
+               if ($subject === NULL || is_scalar($subject)) {
                        return NULL;
                }
                $propertyExists = TRUE;