wp_salt() and more hash work.

git-svn-id: https://develop.svn.wordpress.org/trunk@3811 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-05-31 01:40:00 +00:00
parent feb562c29f
commit 1647921f71
2 changed files with 22 additions and 12 deletions
+13 -5
View File
@@ -508,16 +508,24 @@ function wp_create_nonce($action = -1) {
}
endif;
if ( !function_exists('wp_salt') ) :
function wp_salt() {
$salt = get_option('secret');
if ( empty($salt) )
$salt = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH;
return $salt;
}
endif;
if ( !function_exists('wp_hash') ) :
function wp_hash($data) {
$secret = get_option('secret');
if ( empty($secret) )
$secret = DB_PASSWORD;
$salt = wp_salt();
if ( function_exists('hash_hmac') ) {
return hash_hmac('md5', $data, $secret);
return hash_hmac('md5', $data, $salt);
} else {
return md5($data . $secret);
return md5($data . $salt);
}
}
endif;