[wp-trac] [WordPress Trac] #42985: No error message returned by empty wp-login.php form

WordPress Trac noreply at wordpress.org
Fri Dec 29 11:22:10 UTC 2017


#42985: No error message returned by empty wp-login.php form
------------------------------------+--------------------------------
 Reporter:  zergling81              |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Login and Registration  |     Version:  4.9.1
 Severity:  normal                  |  Resolution:
 Keywords:  needs-patch             |     Focuses:  ui, accessibility
------------------------------------+--------------------------------

Comment (by birgire):

 Within {{{wp_signon()}}} we have this part:


 {{{
 $user = wp_authenticate( $credentials['user_login'],
 $credentials['user_password'] );

 if ( is_wp_error( $user ) ) {
     if ( $user->get_error_codes() == array( 'empty_username',
 'empty_password' ) ) {
         $user = new WP_Error( '', '' );
     }

     return $user;
 }

 }}}

 [https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
 includes/user.php#L90 Source]

 If the username and password fields are both empty, then the corresponding
 error is overridden with {{{$user = new WP_Error( '', '' );}}}. That means
 no error shows up.

 If that would not be the case then we would get the login form shaking and
 the corresponding error messages. See
 [attachment:empty_username_password_errors.JPG]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42985#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list