Make WordPress Core

Opened 8 years ago

Closed 2 years ago

#36983 closed defect (bug) (invalid)

Empty the username/email input field in the case of an `invalid_email`

Reported by: tmatsuur's profile tmatsuur Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5
Component: Login and Registration Keywords: has-screenshots
Focuses: Cc:

Description

If fails to authenticate with an invalid ID is rewritten to blank.
But, in the case of an invalid e-mail address it does not rewrite to blank.

wp-login.php:947

if ( 'invalid_username' == $errors->get_error_code() ) {

It is better to be rewritten in the blank in the case of an invalid ID or an invalid e-mail address.

if ( in_array( $errors->get_error_code(), array( 'invalid_username', 'invalid_email' ) ) ) {

Change History (4)

#1 @desrosj
2 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone set to 6.1
  • Summary changed from To empty the input field in the case of an `invalid_email`. to Empty the username/email input field in the case of an `invalid_email`
  • Type changed from feature request to defect (bug)
  • Version changed from 4.5.2 to 4.5

Hi @tmatsuur,

My apologies that this one took so long to receive a reply!

I've tested against the latest version of WordPress (currently 6.0), and it looks like the behavior is the same. When an invalid username is entered, the username/email field is cleared, but the field is not cleared when an invalid email is entered.

The relevant code has also been changed a bit.

I reviewed the conversation in #9568 where this was originally added (see [36617]), and there's no note of this being intentional, so I think making the behavior consistent is the right thing to do.

#2 @tmatsuur
2 years ago

Thanks @desrosj

Currently, I feel that the situation has changed considerably since I posted this case.

The current error handling is more friendly, and there is also an autocomplete function in the browser.

For this reason, I do not feel as uncomfortable as I used to.

#3 follow-up: @rollybueno
2 years ago

  • Keywords has-screenshots added

Hi @desrosj,

On WP 6.0.1, the behaviour seems to be corrected already. The username/email field will be emptied when I entered invalid email.

The only time it retain the input value is when I entered invalid email without password, which I assume the behaviour should be correct since it's looking for password input first before verifying the email validity. This behaviour will be same if you enter valid email as well.

I have recorded a video on https://drive.google.com/file/d/19kljV_VuMI4IptX5XA2hPb9QWv-hVhc0/view.

#4 in reply to: ↑ 3 @desrosj
2 years ago

  • Keywords needs-patch good-first-bug removed
  • Milestone 6.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Replying to rollybueno:

The only time it retain the input value is when I entered invalid email without password, which I assume the behaviour should be correct since it's looking for password input first before verifying the email validity. This behaviour will be same if you enter valid email as well.

Ah! You're right. I must not have entered a password when I was testing.

I did some archaeology, it seems this was fixed as a part of [45757], though not explicitly mentioned. Going to close this one out.

Note: See TracTickets for help on using tickets.