Project

General

Profile

Actions

Bug #51474

closed

Empty ext_autoload.php results in empty classRegistry

Added by Michel Georgy over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2013-08-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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

ClassLoader.patch (33.2 KB) ClassLoader.patch Patchfile Michel Georgy, 2013-08-28 19:17
Actions

Also available in: Atom PDF