From 561e044ab231baad966ad311a25e4e3e4012551b Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 11 Mar 2010 22:33:52 +0000 Subject: [PATCH] Improve multisite rewrite rules. Construct rules dynamically and skip subdirectory-specific rules for subdomain installs. see #12136 git-svn-id: http://svn.automattic.com/wordpress/trunk@13675 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network.php | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index f4f1dd2a5..9fcfdf43f 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -21,9 +21,10 @@ foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) $wpdb->$table = $prefixed_table; /** - * Check for existing network data/tables. + * Check for an existing network. * * @since 3.0.0 + * @return Whether a network exists. */ function network_domain_check() { global $wpdb; @@ -36,15 +37,14 @@ function network_domain_check() { * Get base domain of network. * * @since 3.0.0 + * @return string Base domain. */ function get_clean_basedomain() { - global $wpdb; - $existing_domain = network_domain_check(); - if ( $existing_domain ) + if ( $existing_domain = network_domain_check() ) return $existing_domain; $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); - if ( strpos( $domain, '/' ) ) - $domain = substr( $domain, 0, strpos( $domain, '/' ) ); + if ( $slash = strpos( $domain, '/' ) ) + $domain = substr( $domain, 0, $slash ); return $domain; } @@ -280,29 +280,30 @@ define( 'BLOG_ID_CURRENT_SITE', 1 ); ?>
  • .htaccess file in %s, replacing other WordPress rules:' ), ABSPATH ); ?>

    -