diff options
-rw-r--r-- | index-install.php | 1 | ||||
-rw-r--r-- | wp-admin/includes/mu.php | 14 | ||||
-rw-r--r-- | wp-config-sample.php | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/index-install.php b/index-install.php index 1a049b6..99c85ed 100644 --- a/index-install.php +++ b/index-install.php @@ -339,6 +339,7 @@ function step2() { break; case "define('SECRET_K": case "define('SECRET_S": + case "define('LOGGED_I": fwrite($handle, str_replace('put your unique phrase here', md5( mt_rand() ) . md5( mt_rand() ), $line)); break; default: diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php index 8d7aa1a..03d6c42 100644 --- a/wp-admin/includes/mu.php +++ b/wp-admin/includes/mu.php @@ -631,11 +631,15 @@ remove_action( 'media_buttons', 'media_buttons' ); function secret_salt_warning() { if( !is_site_admin() ) return; - if( !defined( 'SECRET_KEY' ) || !defined( 'SECRET_SALT' ) ) { - $salt1 = wp_generate_password() . wp_generate_password(); - $salt2 = wp_generate_password() . wp_generate_password(); - $msg = sprintf( __( 'Warning! You must define SECRET_KEY and SECRET_SALT in <strong>%swp-config.php</strong><br />Please add the following code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH ); - $msg .= "<blockquote>define('SECRET_KEY', '$salt1');<br />define('SECRET_SALT', '$salt2');</blockquote>"; + $secret_keys = array( 'SECRET_KEY', 'SECRET_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT' ); + $out = ''; + foreach( $secret_keys as $key ) { + if( !defined( $key ) ) + $out .= "define( '$key', '" . wp_generate_password() . wp_generate_password() . "' );<br />"; + } + if( $out != '' ) { + $msg = sprintf( __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>%swp-config.php</strong> for it to work properly.<br />Please add the code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH ); + $msg .= "<blockquote>$out</blockquote>"; echo "<div id='update-nag'>$msg</div>"; } diff --git a/wp-config-sample.php b/wp-config-sample.php index 11a4d30..72daf8d 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -13,8 +13,10 @@ $base = 'BASE'; // Change SECRET_KEY to a unique phrase. You won't have to remember it later,
// so make it long and complicated. You can visit http://api.wordpress.org/secret-key/1.0/
// to get a secret key generated for you, or just make something up.
-define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
-define('SECRET_SALT', 'put your unique phrase here'); // Change this to a unique phrase.
+define('SECRET_KEY', 'put your unique phrase here'); // Change these to unique phrases.
+define('SECRET_SALT', 'put your unique phrase here');
+define('LOGGED_IN_KEY', 'put your unique phrase here');
+define('LOGGED_IN_SALT', 'put your unique phrase here');
// double check $base
if( $base == 'BASE' )
|