git-svn-id: http://svn.automattic.com/wordpress/trunk@2772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-08-09 22:38:32 +00:00
parent 2919fe2956
commit 376ec4dce5

View File

@ -1,19 +1,20 @@
<?php
// 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 )
if ( 'table_prefix' != $global )
unset( $GLOBALS[$global] );
}
$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
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'] ) ) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?