WordPress.org

Make WordPress Core

Ticket #23104: docroot-not-absolute.diff

File docroot-not-absolute.diff, 849 bytes (added by wpewill, 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        $wp_dir_from_root  = preg_replace( '#^' . preg_quote( realpath( $_SERVER['DOCUMENT_ROOT'] ), '#' ) . '#', '', ABSPATH );
    316316        $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
    317317        $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
    318318