Changeset 45391
- Timestamp:
- 05/23/2019 11:34:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/network.php
r45390 r45391 258 258 } 259 259 260 260 $is_www = ( 0 === strpos( $hostname, 'www.' ) ); 261 261 if ( $is_www ) : 262 262 ?> … … 463 463 } 464 464 ?> 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 465 <ol> 466 <li><p> 467 <?php 468 printf( 469 /* translators: 1: wp-config.php, 2: location of wp-config file, 3: translated version of "That's all, stop editing! Happy publishing." */ 470 __( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ), 471 '<code>wp-config.php</code>', 472 '<code>' . $location_of_wp_config . '</code>', 473 /* 474 * translators: This string should only be translated if wp-config-sample.php is localized. 475 * You can check the localized release package or 476 * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php 477 */ 478 '<code>/* ' . __( 'That’s all, stop editing! Happy publishing.' ) . ' */</code>' 479 ); 480 ?> 481 </p> 482 <textarea class="code" readonly="readonly" cols="100" rows="7"> 483 483 define('MULTISITE', true); 484 484 define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>); … … 488 488 define('BLOG_ID_CURRENT_SITE', 1); 489 489 </textarea> 490 <?php 491 $keys_salts = array( 492 'AUTH_KEY' => '', 493 'SECURE_AUTH_KEY' => '', 494 'LOGGED_IN_KEY' => '', 495 'NONCE_KEY' => '', 496 'AUTH_SALT' => '', 497 'SECURE_AUTH_SALT' => '', 498 'LOGGED_IN_SALT' => '', 499 'NONCE_SALT' => '', 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 ) . "' );"; 490 <?php 491 $keys_salts = array( 492 'AUTH_KEY' => '', 493 'SECURE_AUTH_KEY' => '', 494 'LOGGED_IN_KEY' => '', 495 'NONCE_KEY' => '', 496 'AUTH_SALT' => '', 497 'SECURE_AUTH_SALT' => '', 498 'LOGGED_IN_SALT' => '', 499 'NONCE_SALT' => '', 500 ); 501 foreach ( $keys_salts as $c => $v ) { 502 if ( defined( $c ) ) { 503 unset( $keys_salts[ $c ] ); 513 504 } 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 ) . "' );"; 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 } 518 519 } 519 } 520 $num_keys_salts = count( $keys_salts ); 521 ?> 522 <p> 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 ?> 538 <?php _e( 'To make your installation more secure, you should also add:' ); ?> 539 </p> 540 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> 541 <?php 542 } 543 ?> 544 </li> 520 $num_keys_salts = count( $keys_salts ); 521 ?> 522 <p> 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 ?> 538 <?php _e( 'To make your installation more secure, you should also add:' ); ?> 539 </p> 540 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> 541 <?php 542 } 543 ?> 544 </li> 545 545 <?php 546 546 if ( iis7_supports_permalinks() ) :
Note: See TracChangeset
for help on using the changeset viewer.