You are here: Re: [PHP] php 5.04 register_globals aint acting right. « PHP « IT news, forums, messages
Re: [PHP] php 5.04 register_globals aint acting right.

Posted by "Richard Lynch" on 07/03/25 11:24

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация