Changeset 43571 for trunk/src/wp-admin/includes/network.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/network.php
r42827 r43571 218 218 219 219 if ( allow_subdomain_install() && allow_subdirectory_install() ) : 220 ?>220 ?> 221 221 <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3> 222 222 <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?> … … 251 251 </table> 252 252 253 <?php253 <?php 254 254 endif; 255 255 … … 283 283 '<code>' . $hostname . '</code>' 284 284 ); 285 285 ?> 286 286 </td> 287 287 </tr> … … 412 412 if ( is_multisite() ) { 413 413 $subdomain_install = is_subdomain_install(); 414 ?>414 ?> 415 415 <p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p> 416 <?php416 <?php 417 417 } else { 418 418 $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); 419 ?>419 ?> 420 420 <div class="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div> 421 421 <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p> 422 <?php422 <?php 423 423 } 424 424 } … … 429 429 430 430 if ( $_POST || ! is_multisite() ) { 431 ?>431 ?> 432 432 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 433 433 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> … … 460 460 ?> 461 461 </p></div> 462 <?php463 } 464 ?>462 <?php 463 } 464 ?> 465 465 <ol> 466 466 <li><p> … … 488 488 define('BLOG_ID_CURRENT_SITE', 1); 489 489 </textarea> 490 <?php490 <?php 491 491 $keys_salts = array( 492 492 'AUTH_KEY' => '', … … 499 499 'NONCE_SALT' => '', 500 500 ); 501 foreach ( $keys_salts as $c => $v ) {502 if ( defined( $c ) ) {503 unset( $keys_salts[ $c ] );504 }505 }506 507 if ( ! empty( $keys_salts ) ) {508 $keys_salts_str = '';509 $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );510 if ( is_wp_error( $from_api ) ) {511 foreach ( $keys_salts as $c => $v ) {512 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";513 }514 } else {515 $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );516 foreach ( $keys_salts as $c => $v ) {517 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";518 }519 }520 $num_keys_salts = count( $keys_salts );521 ?>501 foreach ( $keys_salts as $c => $v ) { 502 if ( defined( $c ) ) { 503 unset( $keys_salts[ $c ] ); 504 } 505 } 506 507 if ( ! empty( $keys_salts ) ) { 508 $keys_salts_str = ''; 509 $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); 510 if ( is_wp_error( $from_api ) ) { 511 foreach ( $keys_salts as $c => $v ) { 512 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; 513 } 514 } else { 515 $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); 516 foreach ( $keys_salts as $c => $v ) { 517 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; 518 } 519 } 520 $num_keys_salts = count( $keys_salts ); 521 ?> 522 522 <p> 523 <?php524 if ( 1 == $num_keys_salts ) {525 printf(526 /* translators: %s: wp-config.php */527 __( 'This unique authentication key is also missing from your %s file.' ),528 '<code>wp-config.php</code>'529 );530 } else {531 printf(532 /* translators: %s: wp-config.php */533 __( 'These unique authentication keys are also missing from your %s file.' ),534 '<code>wp-config.php</code>'535 );536 }523 <?php 524 if ( 1 == $num_keys_salts ) { 525 printf( 526 /* translators: %s: wp-config.php */ 527 __( 'This unique authentication key is also missing from your %s file.' ), 528 '<code>wp-config.php</code>' 529 ); 530 } else { 531 printf( 532 /* translators: %s: wp-config.php */ 533 __( 'These unique authentication keys are also missing from your %s file.' ), 534 '<code>wp-config.php</code>' 535 ); 536 } 537 537 ?> 538 538 <?php _e( 'To make your installation more secure, you should also add:' ); ?> 539 539 </p> 540 540 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> 541 <?php542 }543 ?>541 <?php 542 } 543 ?> 544 544 </li> 545 <?php546 if ( iis7_supports_permalinks() ) :547 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us548 $iis_subdir_match = ltrim( $base, '/' ) . $subdir_match;549 $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base;550 $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';551 552 $web_config_file = '<?xml version="1.0" encoding="UTF-8"?>545 <?php 546 if ( iis7_supports_permalinks() ) : 547 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us 548 $iis_subdir_match = ltrim( $base, '/' ) . $subdir_match; 549 $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base; 550 $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}'; 551 552 $web_config_file = '<?xml version="1.0" encoding="UTF-8"?> 553 553 <configuration> 554 554 <system.webServer> … … 559 559 <action type="None" /> 560 560 </rule>'; 561 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {562 $web_config_file .= '561 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 562 $web_config_file .= ' 563 563 <rule name="WordPress Rule for Files" stopProcessing="true"> 564 564 <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" /> 565 565 <action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" /> 566 566 </rule>'; 567 }567 } 568 568 $web_config_file .= ' 569 569 <rule name="WordPress Rule 2" stopProcessing="true"> … … 604 604 '<code>' . $home_path . '</code>' 605 605 ); 606 echo '</p>';607 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) {608 echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';609 }610 ?>606 echo '</p>'; 607 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) { 608 echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 609 } 610 ?> 611 611 <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?> 612 612 </textarea></li> 613 613 </ol> 614 614 615 <?php615 <?php 616 616 else : // end iis7_supports_permalinks(). construct an htaccess file instead: 617 617 … … 652 652 ?> 653 653 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>"> 654 <?php echo esc_textarea( $htaccess_file ); ?></textarea></li>654 <?php echo esc_textarea( $htaccess_file ); ?></textarea></li> 655 655 </ol> 656 656 657 <?php657 <?php 658 658 endif; // end IIS/Apache code branches. 659 659 … … 661 661 ?> 662 662 <p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p> 663 <?php663 <?php 664 664 } 665 665 }
Note: See TracChangeset
for help on using the changeset viewer.