Make WordPress Core

Ticket #32508: 32508.3.patch

File 32508.3.patch, 1.3 KB (added by jwarren, 9 years ago)

Update of original patch to add Wordpress 4.4 as a target

  • pluggable.php

     
    592592                $user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
    593593        }
    594594
    595         $ignore_codes = array('empty_username', 'empty_password');
     595        $empty_codes = array('empty_username', 'empty_password');
    596596
    597         if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
     597        if (is_wp_error($user) && !in_array($user->get_error_code(), $empty_codes) ) {
    598598                /**
    599599                 * Fires after a user login has failed.
    600600                 *
     
    605605                do_action( 'wp_login_failed', $username );
    606606        }
    607607
     608        if ( is_wp_error($user) && 'empty_username' === $user->get_error_code() ) {
     609                /**
     610                 * Fires after a user login has failed due to an empty username.
     611                 *
     612                 * @since 4.4.0
     613                 *
     614                 * @param string $username User login.
     615                 */
     616                do_action( 'wp_login_failed_empty_username', $username );
     617        }
     618        if ( is_wp_error($user) && 'empty_password' === $user->get_error_code() ) {
     619                /**
     620                 * Fires after a user login has failed due to an empty password.
     621                 *
     622                 * @since 4.4.0
     623                 */
     624                do_action( 'wp_login_failed_empty_password' );
     625        }
     626
    608627        return $user;
    609628}
    610629endif;