From 29191fbaf43bfef279b80ab43a282c832f9bf88f Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Wed, 22 Jan 2014 18:20:54 +0100 Subject: [PATCH 1/1] [BUGFIX] Invalid class name to file path conversion MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- typo3/sysext/core/Classes/Core/ClassLoader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.20.1