note 41267 added to security.registerglobals
| From: | snobord787 at msn dot com | Date: | Mon, 05 Apr 2004 01:15:20 +0000 |
| Subject: | note 41267 added to security.registerglobals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67637@lists.php.net to get a copy of this message | ||
<?php
function registered_globals($switch=1){
if($switch){
extract($_REQUEST,EXTR_SKIP);
extract($_SESSION,EXTR_OVERWRITE);
extract($_SERVER,EXTR_OVERWRITE);
extract($_ENV,EXTR_OVERWRITE);
extract($_FILES,EXTR_OVERWRITE);
}else{
$safelist = array('_GET', '_POST', '_COOKIE', '_SERVER',
'_ENV', '_FILES', '_REQUEST', '_SESSION');
foreach(get_defined_vars() as $name => $value)
{
if (!array_search($name, $safelist)) {
unset($$name);
}
}
unset($var_list, $name, $value, $safelist);
}
}
registered_globals(1); // on
registered_globals(0); // off
?>
that is a little function for turning it on and off manually
----
Manual Page -- http://www.php.net/manual/en/security.registerglobals.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41267
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41267&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41267&report=yes
Search -- http://master.php.net/manage/user-notes.php