id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 44672,REST-API: invalid email on lowercase/uppercase change,fuchsws,desrosj,"When changing an email adresse from lower to uppercase (and vice versa) the error ""rest_user_invalid_email"" is thrown. This is wrong and it should work as in edit_user(). Examples: [REST-API] change email from ""UserName@domain.com"" to ""username@domain.com"" results in ERROR [WP-admin] change email from ""UserName@domain.com"" to ""username@domain.com"" results in SUCCESS Both functions use different types of comparisons, while edit_user() is correct and REST-API wrong: WP_REST_Users_Controller > update_item(): {{{#!php user_email ) }}} wp-admin/includes/user.php > edit_user() {{{#!php user_email = sanitize_text_field( wp_unslash( $_POST['email'] ) ); [...] elseif ( ( $owner_id = email_exists($user->user_email) ) && ( !$update || ( $owner_id != $user->ID ) ) ) }}} ",defect (bug),closed,normal,5.1,REST API,4.9.7,normal,fixed,has-patch has-unit-tests commit,,