Password input check in wp_user_update()
-
?Does anyone knows why password equality checks is made without using wp_check_password to compare $userdata[‘user_pass’] and $user_obj->user_pass?
Not so bad, but if the password coming from $userdata ‘user_pass’] is in fact the one present in db, then the following check is wrong:
if ( ! empty( $userdata['user_pass'] ) && $userdata['user_pass'] !== $user_obj->user_pass ) {The passwords are the the same but $userdata[‘user_pass’] is in clear text and $user_obj->user_pass is hashed.
This behaviour got me crazy fo some hours until i realized that the code is this way. If the check is done with password in clear text and password hashed, this equality check is pointless. ?Why not to use the following instead?
if ( ! empty( $userdata['user_pass'] ) && ! wp_check_password( $userdata['user_pass'], $user_obj->user_pass ) {
For sure is something i missed. ?Does anyone knows why this is this way?
- The topic ‘Password input check in wp_user_update()’ is closed to new replies.