WordPress.org

Make WordPress Core

Ticket #22639: 22639.4.patch

File 22639.4.patch, 2.8 KB (added by evansolomon, 2 years 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         = trailingslashit( preg_replace( '#' . preg_quote( $wp_dir_from_root, '#' ) . '$#', '', ABSPATH ) ); 
    318319 
    319320        // Wildcard DNS message. 
    320321        if ( is_wp_error( $errors ) ) 
     
    349350                <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 
    350351                <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 
    351352                <div class="updated inline"><p><?php 
    352                         if ( file_exists( ABSPATH . '.htaccess' ) ) 
     353                        if ( file_exists( $home_path . '.htaccess' ) ) 
    353354                                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' ) ) 
     355                        elseif ( file_exists( $home_path . 'web.config' ) ) 
    355356                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' ); 
    356357                        else 
    357358                                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' ); 
     
    454455EOF; 
    455456 
    456457        ?> 
    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> 
     458                <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> 
    458459                <?php 
    459460                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    460461                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 
     
    488489EOF; 
    489490 
    490491                ?> 
    491                 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 
     492                <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p> 
    492493                <?php 
    493494                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    494495                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';