Last active
December 20, 2015 13:29
-
-
Save voda/6139350 to your computer and use it in GitHub Desktop.
register globals for PHP 5.4+
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 | |
/** | |
* Register globals sucks | |
* use with 'auto_prepend_file' directive | |
*/ | |
foreach (array($_ENV, $_GET, $_POST, $_COOKIE, $_SERVER) as $source) { | |
foreach ($source as $key => $val) { | |
$GLOBALS[$key] = $val; | |
} | |
} | |
foreach ($_FILES as $key => $val) { | |
$GLOBALS["{$key}"] = $val['tmp_name']; | |
$GLOBALS["{$key}_name"] = $val['name']; | |
$GLOBALS["{$key}_size"] = $val['size']; | |
$GLOBALS["{$key}_type"] = $val['type']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment