[TYPO3-50-general] Strange behavior of $this->SERVER in Utility\Environment
Robert Lemke
robert at typo3.org
Fri Jan 23 12:20:02 CET 2009
Hi Christoph,
Am 23.01.2009 um 05:17 schrieb Christoph Blömer:
>> This is what I'm doing. I need to add some more REQUEST_METHOD to the
>> Environment.
Which ones? MOVE, COPY, SEARCH, LOCK, UNLOCK, PROPFIND, PROPPATCH,
MKCOL?
Please let's add them to the original class.
>> So why is it not possible to read the $this->SERVER variable in the
>> child class???
Because the original Environment object has already be instantiated
elsewhere
and the superglobal has been replace.
> I just found out that if I comment out the line:
> $_SERVER = new \F3\FLOW3\Utility\SuperGlobalReplacement('_SERVER',
> 'Please use the ' . __CLASS__ . ' object instead of accessing the
> superglobal directly.');
>
> The $this->SERVER variable is available in the child class of
> F3\FLOW3\Utility\Environment.
> Is that a intended behavior?
yes, because the content of $_SERVER is not sanitized.
If there's really a need for extending the Environment class we can
make that possible.
But I generally think that it's a bad idea in the first place.
Cheers,
robert
More information about the TYPO3-project-5_0-general
mailing list