#38211 [Opn]: variable name and cookie name match breaks script execution
| From: | tokul at users dot sourceforge dot net | Date: | Tue, 25 Jul 2006 18:02:47 +0000 |
| Subject: | #38211 [Opn]: variable name and cookie name match breaks script execution | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99880@lists.php.net to get a copy of this message | ||
ID: 38211
User updated by: tokul at users dot sourceforge dot net
Reported By: tokul at users dot sourceforge dot net
Status: Open
Bug Type: Reproducible crash
Operating System: Linux Debian Sarge
PHP Version: 5CVS-2006-07-25 (snap)
New Comment:
"script displays 'reload script' on first load (cookie is not set)"
means that 'reload script' text is displayed because 'test' cookie is
not set.
Previous Comments:
------------------------------------------------------------------------
[2006-07-25 18:00:23] tokul at users dot sourceforge dot net
Description:
------------
If PHP register_globals are turned on and code tries to unset globals,
unset command can break script execution. It is possible that issue is
not in unset() command. Maybe it is caused by some foreach() function
changes or some session/cookie handling changes.
Issue was reported on php-qa mailing list by Phil Driscoll
(http://news.php.net/php.qa/26841).
PHP 5.2.0rc2-dev (200607251030) snapshot. Compiled as Apache2 DSO
module. register_globals are turned on in php.ini. I can provide
configure command and php.ini settings, if you need them.
error_reporting is set to E_ALL
Can't reproduce it in 5.1.4 or older versions.
Reproduce code:
---------------
<?php
if (!isset($_COOKIE['test'])) {
setcookie('test','somevalue');
echo 'reload script';
} else {
foreach ($_REQUEST as $test => $value) {
// code crashes on unset() call
unset($GLOBALS[$test]);
}
echo time();
}
?>
Expected result:
----------------
script should display 'reload script' on first load and timestamp on
second load.
Actual result:
--------------
script displays 'reload script' on first load (cookie is not set) and
crashes without any visible error when it is reloaded.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38211&edit=1