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:
Ryan Boren
2007-12-24 06:34:12 +00:00
parent 49883447a3
commit 4436a01316
2 changed files with 14 additions and 9 deletions
+12 -7
View File
@@ -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;