Don't trigger wp_login_failed action for empty usernames or passwords.
git-svn-id: https://develop.svn.wordpress.org/trunk@10638 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0e7b3c3903
commit
54b8501261
@ -438,7 +438,9 @@ function wp_authenticate($username, $password) {
|
|||||||
$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
|
$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_wp_error($user)) {
|
$ignore_codes = array('empty_username', 'empty_password');
|
||||||
|
|
||||||
|
if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
|
||||||
do_action('wp_login_failed', $username);
|
do_action('wp_login_failed', $username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user