Update keys and salts with random values from api.wordpress.org. Props nacin. see #12159

git-svn-id: http://svn.automattic.com/wordpress/trunk@13026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-08 18:15:44 +00:00
parent c9d92fc859
commit a8e393c607
2 changed files with 40 additions and 6 deletions

View File

@ -168,6 +168,24 @@ switch($step) {
if ( !empty($wpdb->error) )
wp_die($wpdb->error->get_error_message());
require_once( ABSPATH . WPINC . '/plugin.php' );
require_once( ABSPATH . WPINC . '/http.php' );
wp_fix_server_vars();
/**#@+
* @ignore
*/
function get_bloginfo() {
return 'http://' . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' );
}
/**#@-*/
$secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/?salt=1' );
if ( is_wp_error( $secret_keys ) )
$secret_keys = false;
else
$secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
$key = 0;
foreach ($configFile as $line_num => $line) {
switch (substr($line,0,16)) {
case "define('DB_NAME'":
@ -185,6 +203,17 @@ switch($step) {
case '$table_prefix =':
$configFile[$line_num] = str_replace('wp_', $prefix, $line);
break;
case "define('AUTH_KEY":
case "define('SECURE_A":
case "define('LOGGED_I":
case "define('NONCE_KE":
case "define('AUTH_SAL":
case "define('SECURE_A":
case "define('LOGGED_I":
case "define('NONCE_SA":
if ( $secret_keys )
$configFile[$line_num] = str_replace('put your unique phrase here', substr( $secret_keys[$key++], 27, 64 ), $line );
break;
}
}
if ( ! is_writable(ABSPATH) ) :

View File

@ -34,18 +34,23 @@ define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
/**#@+
* Authentication Unique Keys.
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/?salt=1 WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
/**#@-*/
/**