ID: 22773 Comment by: jcarver at mit dot edu Reported By: joe at mcknight dot de Status: Closed Bug Type: CGI related Operating System: Linux PHP Version: 4.3.2-RC New Comment:
It looks like I'm getting the same error, but in slightly different conditions. I'm on PHP 4.2.2 and have register globals off. I get exactly the same error: When I submit the value "bar", and I print_r the _POST, I expect to get the output: Array ( [foo] => bar ) but instead I get: Array ( [foo] => barfoo=bar ) I just thought it was important to note that it also happens with these conditions: - register_globals can be 'Off' - The $_POST[] array is mangled too - $_GET is unaffected Previous Comments: ------------------------------------------------------------------------ [2003-03-28 11:55:33] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-03-27 12:16:03] [EMAIL PROTECTED] This problem is a rather interesting one, it appears that in CGI the entire POST data makes into the enviroment. You can see this by adding a printf() to _php_import_environment_variables() function. The last element will contain the entire POST string. If that string contains a '=', then data before the '=' becomes the key (variable name) and the rest the variable content. Meaning that by the time the POST variables are registered $suchstr already has a value. One way to fix this is to prevent duplicate variable registration by breaking on the 1st invalid entry from the enviroment inside _php_import_environment_variables(), which happens to be the script name, which is followed by either the POST data or random garbage. Here is the relavent patch: http://bb.prohost.org/22773.txt ------------------------------------------------------------------------ [2003-03-25 05:52:58] [EMAIL PROTECTED] Related to bug #22612 ------------------------------------------------------------------------ [2003-03-24 18:33:26] [EMAIL PROTECTED] That means a command-line test case in tests/basic should fail as well. ------------------------------------------------------------------------ [2003-03-24 18:17:01] [EMAIL PROTECTED] It doesn't matter. I tried two different ways, both failed. For example (otherwise default httpd.conf): AddType application/x-httpd-php .php ScriptAlias /php/ "/www/apache/cgi-bin/" Action application/x-httpd-php /php/php-cgi ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22773 -- Edit this bug report at http://bugs.php.net/?id=22773&edit=1