Bug #51474
closedEmpty ext_autoload.php results in empty classRegistry
100%
Description
If an extension has an empty ext_autoload.php or does not return an array in ext_autoload.php
all other ext_autoload.php entries are lost, because of an array_merge with a NULL value.
The required extensionAutoloadFile should be casted to an array to prevent this issue.
\TYPO3\CMS\Core\Core\ClassLoader.php
static protected function createCoreAndExtensionRegistry(){
... $classRegistry = array_merge($classRegistry, require $extensionAutoloadFile); ...
should be changed to:
... $classRegistry = array_merge($classRegistry, (array) require $extensionAutoloadFile); ...
To reproduce create an empty ext_autoload.php in an Extension and for example try to add a media file to a page record in the backend.
The class TBE_FolderTree fails to load which has an ext_autoload.php from the core extension with following error message:
Fatal error: Class '\TBE_FolderTree' not found in /MyPath/typo3_src-6.1.3/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4111
Files
Updated by Michel Georgy over 10 years ago
- File ClassLoader.patch ClassLoader.patch added
Here is a patchfile of the change
Updated by Markus Klein over 10 years ago
- Subject changed from Empty ext_autoload.php of an extension results in empty classRegistry to Empty ext_autoload.php results in empty classRegistry
- Status changed from New to Accepted
Hi Michel!
Would you mind pushing your patch to our review system? https://review.typo3.org
Feel free to ask me, if you need help.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23441
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23441
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/23456
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23457
Updated by Michel Georgy over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 440ca58780191ca243cb5049c4af4493c4bc3a5d.