summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-09-25 09:10:22 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-09-25 09:10:22 +0000
commit062358ff4e45bd13a0b1c0cf965f46cda0b81774 (patch)
tree55856899cb02f026041e4b8a1cb433e648d548c9
parent831b79ae7346629f71e962e999e60b2b99827380 (diff)
downloadwordpress-mu-062358ff4e45bd13a0b1c0cf965f46cda0b81774.tar.gz
wordpress-mu-062358ff4e45bd13a0b1c0cf965f46cda0b81774.tar.xz
wordpress-mu-062358ff4e45bd13a0b1c0cf965f46cda0b81774.zip
Move PHP_SELF check down, and do not blindly apply to non vhost installs if on the main blog, mostly fixes #745
git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1497 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-settings.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/wp-settings.php b/wp-settings.php
index 9f7fb82..4a7d98c 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -95,10 +95,6 @@ if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'],
if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
unset($_SERVER['PATH_INFO']);
-// Fix empty PHP_SELF
-$PHP_SELF = $_SERVER['PHP_SELF'];
-if ( empty($PHP_SELF) || constant( 'VHOST' ) == 'no' )
- $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
if ( version_compare( '4.3', phpversion(), '>' ) ) {
die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) );
@@ -238,6 +234,11 @@ $wpdb->siteid = $current_blog->site_id;
$wpdb->set_prefix($table_prefix); // set up blog tables
$table_prefix = $table_prefix . $blog_id . '_';
+// Fix empty PHP_SELF
+$PHP_SELF = $_SERVER['PHP_SELF'];
+if ( empty($PHP_SELF) || ( constant( 'VHOST' ) == 'no' && $current_blog->path != '/' ) )
+ $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
+
wp_cache_init(); // need to init cache again after blog_id is set
if ( function_exists('wp_cache_add_global_groups') ) { // need to add these again. Yes, it's an ugly hack
wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss'));