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 #1

Updated by Michel Georgy over 10 years ago

Here is a patchfile of the change

Actions #2

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.

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

Updated by Michel Georgy over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF