Created
March 19, 2015 16:50
-
-
Save smilesrg/35747174a91be7ddf910 to your computer and use it in GitHub Desktop.
Register Globals emulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment