From 2919fe29564b2239ffaa0543cd6c11dc259bb227 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 9 Aug 2005 20:09:20 +0000 Subject: [PATCH] That last thing didn't work at all. git-svn-id: http://svn.automattic.com/wordpress/trunk@2770 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-settings.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-settings.php b/wp-settings.php index 9fd32c2eb7..be83d39e8e 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -3,10 +3,16 @@ $HTTP_HOST = getenv('HTTP_HOST'); /* domain name */ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */ $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */ -// Turn register globals off - Christian Schmidt -if ( ini_get('register_globals') ) - foreach ( array_merge($_REQUEST, $_SERVER, $_ENV) as $name => $value ) - unset($name, $value); +// Turn register globals off +if ( ini_get('register_globals') ) { + $superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); + if ( isset($_SESSION) ) + array_unshift($superglobals, $_SESSION); + + foreach ( $superglobals as $superglobal ) + foreach ( $superglobal as $global => $value ) + unset( $GLOBALS[$global] ); +} // Fix for IIS, which doesn't set REQUEST_URI if ( empty( $_SERVER['REQUEST_URI'] ) ) {