Status: offline

ipqw

Forum User
Newbie
Registered: 02/26/04
Posts: 3
Is there a plan on removing the GL depency of register_globals in php.ini? This dependency is quite inconvenient as many hosts view this as a security risk :-/

Best regards,
Kristian.

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
There is a work around for register_globals being off. I don't now how well this works.
Text Formatted Code
<?php
// Emulate register_globals on
if (!ini_get('register_globals')) {
   $superglobals = array($_SERVER, $_ENV,
       $_FILES, $_COOKIE, $_POST, $_GET);
   if (isset($_SESSION)) {
       array_unshift($superglobals, $_SESSION);
   }
   foreach ($superglobals as $superglobal) {
       extract($superglobal, EXTR_SKIP);
   }
   ini_set('register_globals', true);
}
?>
 

Status: offline

rich0

Forum User
Newbie
Registered: 03/05/05
Posts: 1
Where does this code get posted? In some particular file, or in every file?

Alternatively, is there any way to get apache to set register_globals for geeklog but not for any other locations on the website? I'm willing to trust that geeklog has its ducks in a row, but I doubt that the same is true for every single other PHP application on my website...

Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Just put it in your .htaccess file if you don“t want to enable it for all your sites.

The FAQ

Greetz,
Boris
Vanrillaer.com - our Family Portal