From: Xavier Perseguers Date: Wed, 22 Jan 2014 17:20:54 +0000 (+0100) Subject: [BUGFIX] Invalid class name to file path conversion X-Git-Tag: TYPO3_6-2-0beta5~138 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/29191fbaf43bfef279b80ab43a282c832f9bf88f?hp=b2f4ac419f2d0419ade4198b86575d81aafb408f [BUGFIX] Invalid class name to file path conversion The conversion from a class name such as tx_extensionname_domain_model_somename to its corresponding PHP file does not take Extbase naming conventions for the file name. This yields an wrongly-cased file name which will be validated anyway on case insensitive file systems. This wrong conversion may lead to a PHP fatal error Cannot redeclare class VendorName\Extension\Domain\Model\Somename Fixes: #55256 Releases: 6.2 Change-Id: Ibe512945ac01f53844f790bea9f0d0cf58518c54 Reviewed-on: https://review.typo3.org/26999 Reviewed-by: Markus Klein Tested-by: Markus Klein Reviewed-by: Marcin Sągol Reviewed-by: Stefan Neufeind Tested-by: Marcin Sągol Reviewed-by: Xavier Perseguers Tested-by: Xavier Perseguers --- diff --git a/typo3/sysext/core/Classes/Core/ClassLoader.php b/typo3/sysext/core/Classes/Core/ClassLoader.php index 0c2d841797a1..7ac6c6d38969 100644 --- a/typo3/sysext/core/Classes/Core/ClassLoader.php +++ b/typo3/sysext/core/Classes/Core/ClassLoader.php @@ -333,7 +333,9 @@ class ClassLoader { } else { $classesPath = $this->packageClassesPaths[$extensionKey]; } - $classFilePath = $classesPath . strtr($classNameWithoutVendorAndProduct, $delimiter, '/') . '.php'; + // Naming convention is to capitalize each part of the path + $classNameWithoutVendorAndProduct = ucwords(strtr($classNameWithoutVendorAndProduct, $delimiter, LF)); + $classFilePath = $classesPath . strtr($classNameWithoutVendorAndProduct, LF, '/') . '.php'; if (@file_exists($classFilePath)) { return array($classFilePath, $className); }