Welcome to Geeklog, Anonymous Wednesday, April 24 2024 @ 06:43 pm EDT

Geeklog Forums

Plan on removing dependency of "register_globals"


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.
 Quote

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);
}
?>
 
 Quote

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...
 Quote

Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Location:Sweden
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
 Quote

All times are EDT. The time is now 06:43 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content