From 0069db858cce75ab4b991108c83b7e3b6394e066 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 10 Mar 2010 08:34:42 +0000 Subject: [PATCH] Store subdomain/subdirectory choice in sitemeta. For now, only used in case we return to network.php without constants. see #11816 git-svn-id: http://svn.automattic.com/wordpress/trunk@13642 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 3 ++- wp-admin/network.php | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 875caf461..0f8779e30 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -702,7 +702,8 @@ Thanks! // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) 'siteurl' => get_option( 'siteurl' ), 'add_new_users' => '0', - 'upload_space_check_disabled' => '0' + 'upload_space_check_disabled' => '0', + 'subdomain_install' => intval( $subdomain_install ), ); $insert = ''; diff --git a/wp-admin/network.php b/wp-admin/network.php index 8b31268fc..1bb7b5753 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -168,23 +168,29 @@ function network_step1() { */ function network_step2() { global $base, $wpdb; + $hostname = get_clean_basedomain(); if ( $_POST ) { - $vhost = (bool) $_POST['subdomain_install']; + $vhost = 'localhost' == $hostname ? false : (bool) $_POST['subdomain_install']; } else { if ( is_multisite() ) { $vhost = is_subdomain_install(); ?>

get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); ?>

+

Caution: We recommend you backup your existing wp-config.php and .htaccess files.' ); ?>

    @@ -194,7 +200,7 @@ function network_step2() { define( 'MULTISITE', true ); define( 'VHOST', '' ); $base = ''; -define( 'DOMAIN_CURRENT_SITE', '' ); +define( 'DOMAIN_CURRENT_SITE', '' ); define( 'PATH_CURRENT_SITE', '' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );