WordPress.org

Make WordPress Core

Ticket #22639: 22639.5.diff

File 22639.5.diff, 3.0 KB (added by nacin, 2 years ago)

Refresh of dd32's attempt.

  • wp-admin/network.php

     
    309309function network_step2( $errors = false ) { 
    310310        global $wpdb; 
    311311 
     312        $home_path         = get_home_path(); 
    312313        $hostname          = get_clean_basedomain(); 
    313314        $slashed_home      = trailingslashit( get_option( 'home' ) ); 
    314315        $base              = parse_url( $slashed_home, PHP_URL_PATH ); 
    315         $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH ); 
     316        $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', 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 
     
    353354                <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 
    354355                <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 
    355356                <div class="updated inline"><p><?php 
    356                         if ( file_exists( ABSPATH . '.htaccess' ) ) 
     357                        if ( file_exists( $home_path . '.htaccess' ) ) 
    357358                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' ); 
    358                         elseif ( file_exists( ABSPATH . 'web.config' ) ) 
     359                        elseif ( file_exists( $home_path . 'web.config' ) ) 
    359360                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' ); 
    360361                        else 
    361362                                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' ); 
     
    458459EOF; 
    459460 
    460461        ?> 
    461                 <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> 
     462                <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> 
    462463                <?php 
    463464                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    464465                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 
     
    492493EOF; 
    493494 
    494495                ?> 
    495                 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 
     496                <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p> 
    496497                <?php 
    497498                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 
    498499                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';