Move PHP_SELF setup to wp-settings.php. #2153
git-svn-id: https://develop.svn.wordpress.org/trunk@3382 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
23bf1be299
commit
29e7d65c71
@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// On which page are we ?
|
// On which page are we ?
|
||||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
|
||||||
if ( empty($PHP_SELF) )
|
|
||||||
$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
|
|
||||||
|
|
||||||
if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
|
if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
|
||||||
$pagenow = $self_matches[1];
|
$pagenow = $self_matches[1];
|
||||||
} else if (strstr($PHP_SELF, '?')) {
|
} else if (strstr($PHP_SELF, '?')) {
|
||||||
|
@ -42,6 +42,10 @@ if ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_F
|
|||||||
if ( strstr( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) )
|
if ( strstr( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) )
|
||||||
unset($_SERVER['PATH_INFO']);
|
unset($_SERVER['PATH_INFO']);
|
||||||
|
|
||||||
|
// Fix empty PHP_SELF
|
||||||
|
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||||
|
if ( empty($PHP_SELF) )
|
||||||
|
$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
|
||||||
|
|
||||||
if ( !(phpversion() >= '4.1') )
|
if ( !(phpversion() >= '4.1') )
|
||||||
die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );
|
die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );
|
||||||
|
Loading…
Reference in New Issue
Block a user