mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Tweak
git-svn-id: http://svn.automattic.com/wordpress/trunk@2772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2919fe2956
commit
376ec4dce5
@ -1,19 +1,20 @@
|
|||||||
<?php
|
<?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 */
|
$HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
|
||||||
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
|
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
|
||||||
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
|
$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
|
// Fix for IIS, which doesn't set REQUEST_URI
|
||||||
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
|
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
|
||||||
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?
|
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?
|
||||||
|
Loading…
Reference in New Issue
Block a user