[wp-trac] [WordPress Trac] #44672: REST-API: invalid email on lowercase/uppercase change

WordPress Trac noreply at wordpress.org
Thu Jan 17 21:24:52 UTC 2019


#44672: REST-API: invalid email on lowercase/uppercase change
---------------------------------------------+----------------------
 Reporter:  fuchsws                          |       Owner:  desrosj
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  5.1
Component:  REST API                         |     Version:  4.9.7
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by desrosj):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"44641" 44641]:
 {{{
 #!CommitTicketReference repository="" revision="44641"
 REST API: Allow a user to change the letter casing of their email.

 When a `PUT` request is performed to update a user, a
 `rest_user_invalid_email` error is incorrectly being returned when the
 email exists with different letter casing, even if it belongs to the user
 being updated. `email_exists()` performs a case insensitive lookup, but
 the conditional statement following that lookup was performing a strict
 comparison between the new email and the user’s current email.

 This changes that comparison to instead compare the user ID returned by
 `email_exists()` with the user ID being updated. This more closely matches
 the logic used in `edit_user()` and allows a user to change the letter
 casing of their email.

 Props fuchsws, rachelbaker, desrosj.
 Fixes #44672.
 }}}

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


More information about the wp-trac mailing list