Skip to content

Commit f9328c3

Browse files
committed
Add the trim when checking the password when password is created using wp_hash_password
1 parent a463271 commit f9328c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/pluggable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ function wp_check_password(
28552855
$check = false;
28562856
} elseif ( str_starts_with( $hash, '$wp' ) ) {
28572857
// Check the password using the current prefixed hash.
2858-
$password_to_verify = base64_encode( hash_hmac( 'sha384', $password, 'wp-sha384', true ) );
2858+
$password_to_verify = base64_encode( hash_hmac( 'sha384', trim( $password ), 'wp-sha384', true ) );
28592859
$check = password_verify( $password_to_verify, substr( $hash, 3 ) );
28602860
} elseif ( str_starts_with( $hash, '$P$' ) ) {
28612861
// Check the password using phpass.

0 commit comments

Comments
 (0)