Bug #10428

Wrong Namespace scope when using PhpFrontend

Added by Robert Lemke over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Cache
Start date:
2010-10-25
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

The

__halt_compiler()
instruction in combination with the require mechanism used by the PhpFrontend can cause classes originally being in a global scope to be loaded in the namespace of the last class which has been loaded by the PhpFrontend.

This seems to be a bug in PHP, but until now we were not able to isolate it and write a separate exploit.

bug_10428.zip (2.29 KB) Christopher Hlubek, 2010-10-25 13:53


Related issues

Related to TYPO3.Neos - Task #10426: Implement functional testing support in the Testing package Resolved

Associated revisions

Revision 24362dc5 (diff)
Added by Robert Lemke over 8 years ago

[+BUGFIX] FLOW3 (Cache): Work around PHP __halt_compiler() namespaces bug

The PhpFrontend added a __halt_compiler() instruction to the end of each
cache file to ignore following meta data needed by the cache framework.
This resulted in wrong namespace scopes for certain - originally global -
classes.

Instead of __halt_compiler() we now use a simple "#" comment which should
work equally fine with the current kind of metadata we are using.

Change-Id: I698c15e1053ae87337bb3c914c9c98de35a2e536
Resolves: #10428

History

#1 Updated by Christopher Hlubek over 8 years ago

I created a simple test case where the problem can be reproduced.

#2 Updated by Robert Lemke over 8 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF