note 33291 deleted from security.registerglobals by philip
| From: | philip@php.net | Date: | Wed, 02 Jul 2003 18:44:39 +0000 |
| Subject: | note 33291 deleted from security.registerglobals by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51377@lists.php.net to get a copy of this message | ||
Note Submitter: MPHH
----
This code below will override register_globals to a extent, this should only be used with old code
that is hard or imposible to change.
<?php
/*
* Code made by: MPHH
*/
while (list($vn, $vv)=each($_COOKIE)) {
if (!isset($$vn)) {
$$vn=$vv;
}
}
while (list($vn, $vv)=each($_POST)) {
if (!isset($$vn)) {
$$vn=$vv;
}
}
while (list($vn, $vv)=each($_GET)) {
if (!isset($$vn)) {
$$vn=$vv;
}
}
?>
if $_SESSION is needed than before:
while (list($vn, $vv)=each($_COOKIE)) {
Add:
while (list($vn, $vv)=each($_SESSION)) {
if (!isset($$vn)) {
$$vn=$vv;
}
}
Very simple.