Ticket #22639: 22639.5.diff

File 22639.5.diff, 3.0 KB (added by nacin, 6 months ago)

Refresh of dd32's attempt.

Line 
1Index: wp-admin/network.php
2===================================================================
3--- wp-admin/network.php        (revision 22981)
4+++ wp-admin/network.php        (working copy)
5@@ -309,10 +309,11 @@
6 function network_step2( $errors = false ) {
7        global $wpdb;
8 
9+       $home_path         = get_home_path();
10        $hostname          = get_clean_basedomain();
11        $slashed_home      = trailingslashit( get_option( 'home' ) );
12        $base              = parse_url( $slashed_home, PHP_URL_PATH );
13-       $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH );
14+       $wp_dir_from_root  = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', ABSPATH );
15        $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) );
16        $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
17 
18@@ -353,9 +354,9 @@
19                <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
20                <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
21                <div class="updated inline"><p><?php
22-                       if ( file_exists( ABSPATH . '.htaccess' ) )
23+                       if ( file_exists( $home_path . '.htaccess' ) )
24                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );
25-                       elseif ( file_exists( ABSPATH . 'web.config' ) )
26+                       elseif ( file_exists( $home_path . 'web.config' ) )
27                                printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );
28                        else
29                                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
30@@ -458,7 +459,7 @@
31 EOF;
32 
33        ?>
34-               <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>
35+               <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>
36                <?php
37                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
38                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
39@@ -492,7 +493,7 @@
40 EOF;
41 
42                ?>
43-               <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
44+               <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), $home_path ); ?></p>
45                <?php
46                if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' )
47                        echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';