[wp-trac] [WordPress Trac] #22367: Usernames with "@" char are assumed email addresses, causing incorrect look-up in several places

WordPress Trac noreply at wordpress.org
Thu Dec 17 14:17:39 UTC 2015


#22367: Usernames with "@" char are assumed email addresses, causing incorrect
look-up in several places
-----------------------------------+-----------------------------
 Reporter:  johnjamesjacoby        |       Owner:  johnbillion
     Type:  defect (bug)           |      Status:  reviewing
 Priority:  normal                 |   Milestone:  Future Release
Component:  Users                  |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------------

Comment (by gravitylover):

 I also believe this to be the best option. The patch submitted by John,
 although more correct than the current syntax, will not fix the issue with
 email usernames being able to reset their password. The change in src/wp-
 includes/class-wp-user-query.php is perfect and would be welcomed!

 Replying to [comment:13 dd32]:
 > Perhaps the best option here is to optimize for what we think it is, but
 fall back to login search:
 > {{{
 > $user = false;
 > if ( $search contains '@' )
 >   $user = get_user_by( 'email', $search );
 > if ( ! $user )
 >   $user = get_user_by( 'login', $search );
 > }}}

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


More information about the wp-trac mailing list