On Fri, August 19, 2005 2:14 am, Jochem Maas wrote:
> true. I was just pointing out how easy it is to 'fake'
> register_globals
> personally all my code currently runs this on init - because I don't
> like reg.globals at all:
>
> function unRegisterGlobals()
> {
> if (ini_get('register_globals')) {
> $SGs = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST,
> $_GET);
> if (isset($_SESSION)) { array_unshift($SGs, $_SESSION); }
>
> foreach ($SGs as $sg) {
> foreach ($superglobal as $k => $v) { unset($GLOBALS[ $k
> ]); }
> }
>
> ini_set('register_globals', false);
> }
> }
>
Like, if you are doing this before anything else in your script, I
*THINK* you could just do:
$GLOBALS = array();
instead of all that looping and stuff.
I don't THINK there are any variables you're not nuking anyway...
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php