[wp-trac] [WordPress Trac] #44334: 'Invalid username or email' can just be 'Invalid username' in retrieve_password function

WordPress Trac noreply at wordpress.org
Fri Jun 8 15:04:20 UTC 2018


#44334: 'Invalid username or email' can just be 'Invalid username' in
retrieve_password function
------------------------------------+-----------------------------
 Reporter:  subrataemfluence        |      Owner:  (none)
     Type:  enhancement             |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:
 Severity:  normal                  |   Keywords:  dev-feedback
  Focuses:  administration          |
------------------------------------+-----------------------------
 Since `strpos` returns `false` if a character is not found in between the
 input string and returns `0` if found at the beginning of it the error
 message `There is no user registered with that email address.` will only
 come up if user could not be located with the supplied email address. For
 anything else we can just use `Invalid username`.

 Example: `myname at gmail.com`
 - Error message: There is no user registered with that email address.
 - This is correct since strpos only returns true if @ is somewhere within
 the string or at the end.

 Example: `@myname`
 - Error message: Invalid username
 - No need to add the phrase or email

 Example: `@@myname`
 - Error message: Invalid username
 - No need to add the phrase or email

 Example: `myname`
 - Error message: Invalid username
 - No need to add the phrase or email

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44334>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list