|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-06 20:38 UTC] phpbugs at thequod dot de
Description:
------------
I've just discovered a nasty bug: in phpMyAdmin's
index.php gets a file required:
require_once('./libraries/common.lib.php');
Inside this file then, $_SERVER is shortened to just two
entries: PHP_SELF and REQUEST_TIME (I've added a
var_dump() at the beginning).
However, var_dump($_SERVER) in index.php before the
include outputs the whole array.
And additionally, now it is correctly filled in the
include's var_dump(): Just accessing $_SERVER (through
var_dump() or $a = $_SERVER) before the include corrects
it inside the include.
Reproduce code:
---------------
I could not reproduce it with a small test script, but with phpMyAdmin 2.8.0.3.
I'm using Apache2 and PHP as FastCGI.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 19:00:01 2025 UTC |
To reproduce: --- SERVER.php --- <?php # If $_SERVER does not get accessed in this script, it is nearly empty in the include: #echo 'Count($_SERVER): '.count($_SERVER)."\n"; require_once('./SERVER.inc.php'); # "Accessing" $_ENV here makes $_SERVER empty in the include: $foo = empty($_ENV); ?> --- SERVER.inc.php --- <?php # This will be 2, if $_ENV gets accessed in the main script, but not $_SERVER! echo 'Count($_SERVER) (Include): '.count($_SERVER)."\n"; ?>