Index: user.php
===================================================================
--- user.php	(revision 17575)
+++ user.php	(working copy)
@@ -1542,34 +1542,30 @@
  * @param array $userdata An array of user data.
  * @return int The updated user's ID.
  */
-function wp_update_user($userdata) {
+function wp_update_user( $userdata ) {
 	$ID = (int) $userdata['ID'];
 
 	// First, get all of the original fields
-	$user = get_userdata($ID);
+	$user = get_userdata( $ID );
 
-	// Escape data pulled from DB.
-	$user = add_magic_quotes(get_object_vars($user));
-
-	// If password is changing, hash it now.
-	if ( ! empty($userdata['user_pass']) ) {
-		$plaintext_pass = $userdata['user_pass'];
-		$userdata['user_pass'] = wp_hash_password($userdata['user_pass']);
+	// Escape data pulled from DB if any data was pulled. Otherwise make the variable an empty array to use with array_merge() later on
+	if( $user ) {
+		$user = add_magic_quotes( get_object_vars( $user ) );
+	} else {
+		$user = array();
 	}
+	
+	wp_cache_delete( $user[ 'user_email' ], 'useremail' );
 
-	wp_cache_delete($user[ 'user_email' ], 'useremail');
-
 	// Merge old and new fields with new fields overwriting old ones.
-	$userdata = array_merge($user, $userdata);
-	$user_id = wp_insert_user($userdata);
+	$userdata = array_merge( $user, $userdata );
+	$user_id = wp_insert_user( $userdata );
 
 	// Update the cookies if the password changed.
 	$current_user = wp_get_current_user();
-	if ( $current_user->id == $ID ) {
-		if ( isset($plaintext_pass) ) {
-			wp_clear_auth_cookie();
-			wp_set_auth_cookie($ID);
-		}
+	if ( $current_user->id == $ID && ! empty( $userdata['user_pass'] ) ) {
+		wp_clear_auth_cookie();
+		wp_set_auth_cookie($ID);
 	}
 
 	return $user_id;
