ID: 39450
User updated by: patrik dot mayer at i12 dot de
Reported By: patrik dot mayer at i12 dot de
-Status: Feedback
+Status: Open
Bug Type: Unknown/Other Function
Operating System: SuSE 10, 2.6.13-15.12-smp
PHP Version: 5.2.0
New Comment:
I've done a little bit more testing - sorry that I have'nt done this
before.
It seems that on our development Server register_globals is On. So i
turned it off - same result. But in second stage i realized that
register_long_arrays is also On. Turned this Off too and it worked.
So, if register_globals OR register_long_arrays is On getenv() writes
the catched environment-variables to the $_POST-Array.
Thanks for your patience.
Previous Comments:
------------------------------------------------------------------------
[2006-11-10 09:48:58] [EMAIL PROTECTED]
I don't think anybody else can confirm this, as it sounds .. well..
like a pure nonsense.
Please rebuild PHP and try on another machine.
------------------------------------------------------------------------
[2006-11-10 08:36:25] patrik dot mayer at i12 dot de
Hmm, can anyone confirm this?
What could I have done wrong?
thnx.
------------------------------------------------------------------------
[2006-11-09 17:06:54] [EMAIL PROTECTED]
Cannot reproduce with both Apache and Apache2 on SuSE.
------------------------------------------------------------------------
[2006-11-09 14:30:05] patrik dot mayer at i12 dot de
Description:
------------
The getenv() function fills the $_POST-Array for every variable that it
gets from the environment. So, if you want to getenv "HTTP_HOST" you
will have $_POST['HTTP_HOST'] filled after the getenv() Statement.
Reproduce code:
---------------
<?php
echo "<pre>".print_r($_POST, true)."</pre><br/><br/>";
echo getenv('SERVER_PROTOCOL').'<br/>';
echo getenv('REMOTE_PORT').'<br/>';
echo "<br/>";
echo "<pre>".print_r($_POST, true)."</pre>";
?>
Expected result:
----------------
Array
(
)
HTTP/1.1
4175
Array
(
)
//tested on PHP 5.1.6
Actual result:
--------------
Array
(
)
HTTP/1.1
4175
Array
(
[HTTP_HOST] => development.i12.de
[SERVER_PROTOCOL] => HTTP/1.1
[REMOTE_PORT] => 4175
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39450&edit=1