Allow DB salt to be overridden by SECRET_SALT. Add a filter to wp_salt(). see #5367
git-svn-id: https://develop.svn.wordpress.org/trunk@6478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
49883447a3
commit
4436a01316
@ -9,8 +9,8 @@ define('DB_COLLATE', '');
|
|||||||
|
|
||||||
// Change SECRET_KEY to a unique phrase. You won't have to remember it later,
|
// Change SECRET_KEY to a unique phrase. You won't have to remember it later,
|
||||||
// so make it long and complicated. You can visit https://www.grc.com/passwords.htm
|
// so make it long and complicated. You can visit https://www.grc.com/passwords.htm
|
||||||
// to get a phrase generated for you.
|
// to get a phrase generated for you, or just make something up.
|
||||||
define('SECRET_KEY', ''); // Change this to a unique phrase.
|
define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
|
||||||
|
|
||||||
// You can have multiple installations in one database if you give each a unique prefix
|
// You can have multiple installations in one database if you give each a unique prefix
|
||||||
$table_prefix = 'wp_'; // Only numbers, letters, and underscores please!
|
$table_prefix = 'wp_'; // Only numbers, letters, and underscores please!
|
||||||
|
@ -700,16 +700,21 @@ endif;
|
|||||||
if ( !function_exists('wp_salt') ) :
|
if ( !function_exists('wp_salt') ) :
|
||||||
function wp_salt() {
|
function wp_salt() {
|
||||||
|
|
||||||
if ( defined('SECRET_KEY') && '' != SECRET_KEY )
|
$secret_key = '';
|
||||||
return SECRET_KEY;
|
if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ('put your unique phrase here' != SECRET_KEY) )
|
||||||
|
$secret_key = SECRET_KEY;
|
||||||
|
|
||||||
|
if ( defined('SECRET_SALT') ) {
|
||||||
|
$salt = SECRET_SALT;
|
||||||
|
} else {
|
||||||
$salt = get_option('secret');
|
$salt = get_option('secret');
|
||||||
if ( empty($salt) ) {
|
if ( empty($salt) ) {
|
||||||
$salt = wp_generate_password();
|
$salt = wp_generate_password();
|
||||||
update_option('secret', $salt);
|
update_option('secret', $salt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $salt;
|
return apply_filters('salt', $salt);
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user