[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
Tue Oct 7 04:22:24 UTC 2014


#22367: Usernames with "@" char are assumed email addresses, causing incorrect
look-up in several places
---------------------------------+------------------------------
 Reporter:  johnjamesjacoby      |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Users                |     Version:
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.6-early  |     Focuses:
---------------------------------+------------------------------

Comment (by 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:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list