Move PHP_SELF setup to wp-settings.php. #2153

git-svn-id: http://svn.automattic.com/wordpress/trunk@3382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-29 23:11:26 +00:00
parent 095edb0aea
commit 38f4fca0db
2 changed files with 4 additions and 4 deletions

View File

@ -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, '?')) {

View File

@ -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' );