Merge pull request #8467 from woothemes/generic-login-error-message
Don't reveal username when login failed on valid email login
This commit is contained in:
commit
5d4ea2433d
|
@ -794,7 +794,9 @@ class WC_Form_Handler {
|
||||||
$user = wp_signon( apply_filters( 'woocommerce_login_credentials', $creds ), $secure_cookie );
|
$user = wp_signon( apply_filters( 'woocommerce_login_credentials', $creds ), $secure_cookie );
|
||||||
|
|
||||||
if ( is_wp_error( $user ) ) {
|
if ( is_wp_error( $user ) ) {
|
||||||
throw new Exception( $user->get_error_message() );
|
$message = $user->get_error_message();
|
||||||
|
$message = str_replace( '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', '<strong>' . esc_html( $_POST['username'] ) . '</strong>', $message );
|
||||||
|
throw new Exception( $message );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( ! empty( $_POST['redirect'] ) ) {
|
if ( ! empty( $_POST['redirect'] ) ) {
|
||||||
|
|
Loading…
Reference in New Issue