mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -700,16 +700,21 @@ endif;
|
||||
if ( !function_exists('wp_salt') ) :
|
||||
function wp_salt() {
|
||||
|
||||
if ( defined('SECRET_KEY') && '' != SECRET_KEY )
|
||||
return SECRET_KEY;
|
||||
$secret_key = '';
|
||||
if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ('put your unique phrase here' != SECRET_KEY) )
|
||||
$secret_key = SECRET_KEY;
|
||||
|
||||
$salt = get_option('secret');
|
||||
if ( empty($salt) ) {
|
||||
$salt = wp_generate_password();
|
||||
update_option('secret', $salt);
|
||||
if ( defined('SECRET_SALT') ) {
|
||||
$salt = SECRET_SALT;
|
||||
} else {
|
||||
$salt = get_option('secret');
|
||||
if ( empty($salt) ) {
|
||||
$salt = wp_generate_password();
|
||||
update_option('secret', $salt);
|
||||
}
|
||||
}
|
||||
|
||||
return $salt;
|
||||
return apply_filters('salt', $salt);
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user