[BUGFIX] Class loader loads aliased classes twice 70/27570/2
authorChristian Weiske <christian.weiske@netresearch.de>
Wed, 12 Feb 2014 07:41:36 +0000 (08:41 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Thu, 13 Feb 2014 05:04:33 +0000 (06:04 +0100)
Check if a class already exists before requiring the file.

Change-Id: I555d259f7fb869428d20b63d2766684bb21c1a5c
Fixes: #55904
Releases: 6.2
Reviewed-on: https://review.typo3.org/27570
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/core/Classes/Core/ClassLoader.php

index fb03dc2..f1d0062 100644 (file)
@@ -175,7 +175,11 @@ class ClassLoader {
 
                $loadingSuccessful = FALSE;
                if ($classLoadingInformation !== NULL) {
-                       $loadingSuccessful = (boolean)require_once $classLoadingInformation[0];
+                       if (class_exists($classLoadingInformation[1], FALSE)) {
+                               $loadingSuccessful = TRUE;
+                       } else {
+                               $loadingSuccessful = (boolean)require_once $classLoadingInformation[0];
+                       }
                }
                if ($loadingSuccessful && count($classLoadingInformation) > 2) {
                        $originalClassName = $classLoadingInformation[1];