From 25729cb3c5b001dea0f8a36f051cf73c58bff4a9 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 6 Dec 2010 15:26:30 +0000 Subject: [PATCH] Optimize the keys/salts textarea. fixes #15092. git-svn-id: http://svn.automattic.com/wordpress/trunk@16746 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index 01006442d..1c36a434b 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -365,27 +365,24 @@ define( 'BLOG_ID_CURRENT_SITE', 1 ); if ( defined( $c ) ) unset( $keys_salts[ $c ] ); } - if ( ! empty( $keys_salts ) ) { + if ( ! empty( $keys_salts ) ) { + $keys_salts_str = ''; $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); if ( is_wp_error( $from_api ) ) { foreach ( $keys_salts as $c => $v ) { - $keys_salts[ $c ] = wp_generate_password( 64, true, true ); + $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; } } else { $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); foreach ( $keys_salts as $c => $v ) { - $keys_salts[ $c ] = substr( array_shift( $from_api ), 28, 64 ); + $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; } } $num_keys_salts = count( $keys_salts ); ?>

wp-config.php file.', 'These unique authentication keys are also missing from your wp-config.php file.', $num_keys_salts ); ?>

- +