Deleted forum_unregister_globals() function
This commit is contained in:
parent
60c4f6e587
commit
52271def0a
3 changed files with 0 additions and 35 deletions
|
@ -59,9 +59,6 @@ if (!defined('PUN_DEBUG'))
|
|||
// Load the functions script
|
||||
require PUN_ROOT.'include/functions.php';
|
||||
|
||||
// Reverse the effect of register_globals
|
||||
forum_unregister_globals();
|
||||
|
||||
// Turn on full PHP error reporting
|
||||
error_reporting(E_ALL);
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ require PUN_ROOT.'include/functions.php';
|
|||
// Load addon functionality
|
||||
require PUN_ROOT.'include/addons.php';
|
||||
|
||||
// Reverse the effect of register_globals
|
||||
forum_unregister_globals();
|
||||
|
||||
// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
|
||||
setlocale(LC_CTYPE, 'C');
|
||||
|
||||
|
|
|
@ -1772,35 +1772,6 @@ H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADD
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Unset any variables instantiated as a result of register_globals being enabled
|
||||
//
|
||||
function forum_unregister_globals() //????
|
||||
{
|
||||
$register_globals = ini_get('register_globals');
|
||||
if ($register_globals === '' || $register_globals === '0' || strtolower($register_globals) === 'off')
|
||||
return;
|
||||
|
||||
// Prevent script.php?GLOBALS[foo]=bar
|
||||
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
|
||||
exit('I\'ll have a steak sandwich and... a steak sandwich.');
|
||||
|
||||
// Variables that shouldn't be unset
|
||||
$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
|
||||
|
||||
// Remove elements in $GLOBALS that are present in any of the superglobals
|
||||
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
|
||||
foreach ($input as $k => $v)
|
||||
{
|
||||
if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
|
||||
{
|
||||
unset($GLOBALS[$k]);
|
||||
unset($GLOBALS[$k]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Removes any "bad" characters (characters which mess with the display of a page, are invisible, etc) from user input
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue