Make WordPress Core

Changeset 23296


Ignore:
Timestamp:
01/10/2013 08:10:14 AM (11 years ago)
Author:
markjaquith
Message:

Resolve DOCUMENT_ROOT symlinks and standardize Windows slashing for various paths related to Multisite rewrite rule generation. props SergeyBiryukov, nacin, wpewill. fixes #23104 and #23073 for 3.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-admin/network.php

    r23178 r23296  
    313313    $slashed_home      = trailingslashit( get_option( 'home' ) );
    314314    $base              = parse_url( $slashed_home, PHP_URL_PATH );
    315     $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH );
    316     $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
     315    $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
     316    $abspath_fix       = str_replace( '\\', '/', ABSPATH );
     317    $home_path         = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : str_replace( '\\', '/', get_home_path() );
     318    $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );
    317319    $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
    318320
    319     $home_path         = get_home_path();
    320321
    321322    $location_of_wp_config = ABSPATH;
Note: See TracChangeset for help on using the changeset viewer.