X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..refs/tags/wordpress-3.5.1:/wp-admin/network.php diff --git a/wp-admin/network.php b/wp-admin/network.php index f9a2f1d3..d5549145 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -312,11 +312,12 @@ function network_step2( $errors = false ) { $hostname = get_clean_basedomain(); $slashed_home = trailingslashit( get_option( 'home' ) ); $base = parse_url( $slashed_home, PHP_URL_PATH ); - $wp_dir_from_root = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH ); - $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) ); + $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) ); + $abspath_fix = str_replace( '\\', '/', ABSPATH ); + $home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : str_replace( '\\', '/', get_home_path() ); + $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix ); $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' ) ) @@ -411,8 +412,7 @@ define('BLOG_ID_CURRENT_SITE', 1); $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base; $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}'; - $web_config_file = << + $web_config_file = ' @@ -424,14 +424,14 @@ define('BLOG_ID_CURRENT_SITE', 1); if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { $web_config_file .= ' - - + + '; } $web_config_file .= ' - - + + @@ -442,12 +442,12 @@ define('BLOG_ID_CURRENT_SITE', 1); - - + + - - + + @@ -456,8 +456,7 @@ define('BLOG_ID_CURRENT_SITE', 1); - -EOF; +'; ?>
  • web.config file in %s, replacing other WordPress rules:' ), $home_path ); ?>