Retrieve password: keys doesn’t match.
-
Hi all… I think this is my first topic on support.
At first, please, sorry by lang ??I don’t know if could be a bug but… i have a little problem with retrieve password function:
retrieve_password()
1. The function generates and returns an user_activation_key, with extra characters, that inserts on the user field of database.
2. The function sends correctly this key ($key), also with these extra characters.
wp_generate_password(20, false)
reset_password($key)
But the check function for this key ($key), retrieves an clean key of these characters:
$key = preg_replace('/[^a-z0-9]/i', '', $key);
So, this is the problem:
the key saved in the DataBase doesn’t match with the key sent by email because reset_password($key) cleans the key of these extra characters.Ummm… I think the md5() function never works.
—
My temporally correction it’s apply the same replacement of Key sent in the key that we have retrieved:function reset_password($key) { global $wpdb; // Mod by Covi: FIXME - Error, activation_key have extra characters: $key = preg_replace('/[^a-z0-9]/i', '', $key); if ( empty( $key ) )[...]
I’m sure the problem is mine, but… someone can help me? ??
Regards and sorry by lang again.
- The topic ‘Retrieve password: keys doesn’t match.’ is closed to new replies.