From 40e9cce21d7ed8eca6294122996a7d39048fa322 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 3 Dec 2012 03:42:02 +0000 Subject: [PATCH] When creating a network, use get_home_path() to calculate where .htaccess (or web.config) lives. fixes #22639. git-svn-id: https://develop.svn.wordpress.org/trunk@22982 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/network.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index d695bf4dca..f9a2f1d39d 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -316,6 +316,8 @@ function network_step2( $errors = false ) { $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) ); $rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : ''; + $home_path = get_home_path(); + $location_of_wp_config = ABSPATH; if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) $location_of_wp_config = trailingslashit( dirname( ABSPATH ) ); @@ -344,7 +346,7 @@ function network_step2( $errors = false ) { } } - $subdir_match = $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?'; + $subdir_match = $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?'; $subdir_replacement_01 = $subdomain_install ? '' : '$1'; $subdir_replacement_12 = $subdomain_install ? '$1' : '$2'; @@ -353,9 +355,9 @@ function network_step2( $errors = false ) {

Caution: We recommend you back up your existing wp-config.php and %s files.' ), '.htaccess' ); - elseif ( file_exists( ABSPATH . 'web.config' ) ) + elseif ( file_exists( $home_path . 'web.config' ) ) printf( __( 'Caution: We recommend you back up your existing wp-config.php and %s files.' ), 'web.config' ); else _e( 'Caution: We recommend you back up your existing wp-config.php file.' ); @@ -458,7 +460,7 @@ define('BLOG_ID_CURRENT_SITE', 1); EOF; ?> -

  • web.config file in %s, replacing other WordPress rules:' ), trailingslashit( str_replace( trailingslashit( $wp_siteurl_subdir ), '', ABSPATH ) ) ); ?>

    +
  • web.config file in %s, replacing other WordPress rules:' ), $home_path ); ?>

    ' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    '; @@ -492,7 +494,7 @@ RewriteRule . index.php [L] EOF; ?> -
  • .htaccess file in %s, replacing other WordPress rules:' ), ABSPATH ); ?>

    +
  • .htaccess file in %s, replacing other WordPress rules:' ), $home_path ); ?>

    ' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    ';