WordPress.org

Make WordPress Core

Ticket #22639: 22639.diff

File 22639.diff, 2.9 KB (added by ryan, 17 months ago)
  • wp-admin/network.php

     
    315315        $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $_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 ), '/' ) : ''; 
     318        $home_path = ABSPATH; 
     319        if ( '/' != $wp_dir_from_root ) 
     320                $home_path = trailingslashit( str_replace( $wp_dir_from_root, '', ABSPATH ) ); 
    318321 
    319322        // Wildcard DNS message. 
    320323        if ( is_wp_error( $errors ) ) 
     
    349352                <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 
    350353                <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 
    351354                <div class="updated inline"><p><?php 
    352                         if ( file_exists( ABSPATH . '.htaccess' ) ) 
     355                        if ( file_exists( trailingslashit( $home_path . '.htaccess' ) ) ) 
    353356                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' ); 
    354                         elseif ( file_exists( ABSPATH . 'web.config' ) ) 
     357                        elseif ( file_exists( trailingslashit( $home_path . 'web.config' ) ) ) 
    355358                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' ); 
    356359                        else 
    357360                                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' ); 
     
    454457EOF; 
    455458 
    456459        ?> 
    457                 <li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), trailingslashit( str_replace( trailingslashit( $wp_siteurl_subdir ), '', ABSPATH ) ) ); ?></p> 
     460                <li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p> 
    458461                <?php 
    459462                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    460463                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 
     
    488491EOF; 
    489492 
    490493                ?> 
    491                 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 
     494                <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p> 
    492495                <?php 
    493496                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    494497                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';