Don't trigger wp_login_failed action for empty usernames or passwords.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2df038fac9
commit
3f22da5123
|
@ -438,7 +438,9 @@ function wp_authenticate($username, $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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue