NOTE:
this basicly mimics the way register_globals works.
I use this code to fix register_globals aswell as the magic_quotes_gpc:
$global = @array($_SESSION, $_SERVER, $_COOKIE, $_POST, $_GET, $_FILES,
$_ENV);
$global_old = @array($HTTP_SESSION_VARS, $HTTP_SERVER_VARS,
$HTTP_COOKIE_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_FILES_VARS,
$HTTP_ENV_VARS);
if(!$global[1]){
$global = $global_old;
}
if(!@ini_get('magic_quotes_gpc')){
foreach($global as $array){
if(is_array($array)){
foreach($array as $key=>$val){
$$key = addslashes($val);
}
}
}
}else{
foreach($global as $array){
if(is_array($array)){
foreach($array as $key=>$val){
$$key = $val;
}
}
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- [PHP] No Global Code Fixing Michael J. Pawlowsky
- Re: [PHP] No Global Code Fixing Rasmus Lerdorf
- Re: [PHP] No Global Code Fixing Michael J. Pawlowsky
- Re: [PHP] No Global Code Fixing Tularis
- Re: [PHP] No Global Code Fixing Michael J. Pawlowsky
- Re: [PHP] No Global Code Fixing Jason Sheets