From 062358ff4e45bd13a0b1c0cf965f46cda0b81774 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 25 Sep 2008 09:10:22 +0000 Subject: 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 --- wp-settings.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'wp-settings.php') 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')); -- cgit