Ticket #22639: 22639.4.diff
| File 22639.4.diff, 4.0 KB (added by dd32, 7 months ago) |
|---|
-
wp-admin/network.php
309 309 function network_step2( $errors = false ) { 310 310 global $wpdb; 311 311 312 $home_path = get_home_path(); 312 313 $hostname = get_clean_basedomain(); 313 314 $slashed_home = trailingslashit( get_option( 'home' ) ); 314 315 $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 ); 316 317 $wp_siteurl_subdir = trailingslashit( '/' . preg_replace( '#^' . preg_quote( $base, '#' ) . '#', '', $wp_dir_from_root ) ); 317 318 $rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : ''; 318 319 320 $location_of_wp_config = ABSPATH; 321 if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) 322 $location_of_wp_config = trailingslashit( dirname( ABSPATH ) ); 323 319 324 // Wildcard DNS message. 320 325 if ( is_wp_error( $errors ) ) 321 326 echo '<div class="error">' . $errors->get_error_message() . '</div>'; … … 349 354 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 350 355 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 351 356 <div class="updated inline"><p><?php 352 if ( file_exists( ABSPATH. '.htaccess' ) )357 if ( file_exists( $home_path . '.htaccess' ) ) 353 358 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' ) )359 elseif ( file_exists( $home_path . 'web.config' ) ) 355 360 printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' ); 356 361 else 357 362 _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' ); … … 360 365 } 361 366 ?> 362 367 <ol> 363 <li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That’s all, stop editing! Happy blogging. */</code>:' ), ABSPATH); ?></p>368 <li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That’s all, stop editing! Happy blogging. */</code>:' ), $location_of_wp_config ); ?></p> 364 369 <textarea class="code" readonly="readonly" cols="100" rows="6"> 365 370 define('MULTISITE', true); 366 371 define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>); … … 454 459 EOF; 455 460 456 461 ?> 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>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> 458 463 <?php 459 464 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 460 465 echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; … … 488 493 EOF; 489 494 490 495 ?> 491 <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> 492 497 <?php 493 498 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 494 499 echo '<p><strong>' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';