diff --git a/src/wp-includes/user-functions.php b/src/wp-includes/user-functions.php index 856ca673c8..701e38cf34 100644 --- a/src/wp-includes/user-functions.php +++ b/src/wp-includes/user-functions.php @@ -136,8 +136,14 @@ function wp_authenticate_username_password($user, $username, $password) { $user = get_user_by('login', $username); - if ( !$user ) - return new WP_Error( 'invalid_username', sprintf( __( 'ERROR: Invalid username. Lost your password?' ), wp_lostpassword_url() ) ); + if ( !$user ) { + return new WP_Error( 'invalid_username', + __( 'ERROR: Invalid username.' ) . + ' ' . + __( 'Lost your password?' ) . + '' + ); + } /** * Filter whether the given user can be authenticated with the provided $password. @@ -152,9 +158,18 @@ function wp_authenticate_username_password($user, $username, $password) { if ( is_wp_error($user) ) return $user; - if ( !wp_check_password($password, $user->user_pass, $user->ID) ) - return new WP_Error( 'incorrect_password', sprintf( __( 'ERROR: The password you entered for the username %1$s is incorrect. Lost your password?' ), - $username, wp_lostpassword_url() ) ); + if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) { + return new WP_Error( 'incorrect_password', + sprintf( + /* translators: %s: user name */ + __( 'ERROR: The password you entered for the username %s is incorrect.' ), + '' . $username . '' + ) . + ' ' . + __( 'Lost your password?' ) . + '' + ); + } return $user; }