WordPress.org

Make WordPress Core

Ticket #23073: 23073.patch

File 23073.patch, 945 bytes (added by SergeyBiryukov, 5 years ago)
  • wp-admin/network.php

     
    312312        $hostname          = get_clean_basedomain();
    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 );
     315        $document_root     = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
     316        $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $document_root, '#' ) . '#', '', str_replace( '\\', '/', ABSPATH ) );
    316317        $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
    317318        $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
    318319