note 32470 added to security.registerglobals

From: Date: Wed, 28 May 2003 16:28:51 +0000
Subject: note 32470 added to security.registerglobals
Groups: php.notes 
Request: Send a blank email to php-notes+get-49182@lists.php.net to get a copy of this message
This is a safe way to override register_globals off [code] // // For PHP's register globals off // This is a safe way to override that. // Created by: MPHH // while(list($varn, $varv) = @each($_COOKIE)) { if (is_null($$varn)) { $$varn=$varv; } } while(list($varn, $varv) = @each($_POST)) { if (is_null($$varn)) { $$varn=$varv; } } while(list($varn, $varv) = @each($_GET)) { if (is_null($$varn)) { $$varn=$varv; } } $varn=null; $varv=null; [/code] I hope this helps. ---- Manual Page -- http://www.php.net/manual/en/security.registerglobals.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32470 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32470&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32470&report=yes

« previous php.notes (#49182) next »