From cf9f85dc8121a359d550ffa3b735fb48859eee88 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 24 Apr 2008 11:45:39 +0000 Subject: Merged with WP 2.5, revision 7806 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1260 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/pluggable.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'wp-includes/pluggable.php') diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 4c457a9..4a35347 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1078,11 +1078,7 @@ if ( !function_exists('wp_hash') ) : function wp_hash($data) { $salt = wp_salt(); - if ( function_exists('hash_hmac') ) { - return hash_hmac('md5', $data, $salt); - } else { - return md5($data . $salt); - } + return hash_hmac('md5', $data, $salt); } endif; @@ -1174,12 +1170,11 @@ if ( !function_exists('wp_generate_password') ) : * * @return string The random password **/ -function wp_generate_password() { - $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - $length = 7; +function wp_generate_password($length = 12) { + $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()"; $password = ''; for ( $i = 0; $i < $length; $i++ ) - $password .= substr($chars, mt_rand(0, 61), 1); + $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); return $password; } endif; @@ -1336,7 +1331,7 @@ if ( !function_exists('wp_login') ) : * global for why there was a failure can utilize it later. * * @since 1.2.2 - * @deprecated Use wp_signin() + * @deprecated Use wp_signon() * @global string $error Error when false is returned * * @param string $username User's username -- cgit