Ticket #22367: 22367.2.patch
File 22367.2.patch, 1.9 KB (added by , 9 years ago) |
---|
-
src/wp-admin/user-new.php
34 34 35 35 $user_details = null; 36 36 $user_email = wp_unslash( $_REQUEST['email'] ); 37 if ( false !== strpos( $user_email, '@') ) {37 if ( is_email( $user_email ) ) { 38 38 $user_details = get_user_by( 'email', $user_email ); 39 39 } else { 40 40 if ( is_super_admin() ) { -
src/wp-includes/class-wp-user-query.php
373 373 if ( $qv['search_columns'] ) 374 374 $search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' ) ); 375 375 if ( ! $search_columns ) { 376 if ( false !== strpos( $search, '@' ) )377 $search_columns = array( 'user_email');376 if ( false !== strpos( $search, '@' ) ) 377 $search_columns = array( 'user_email', 'user_login' ); 378 378 elseif ( is_numeric($search) ) 379 379 $search_columns = array('user_login', 'ID'); 380 380 elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) ) -
src/wp-login.php
282 282 283 283 if ( empty( $_POST['user_login'] ) ) { 284 284 $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or email address.')); 285 } elseif ( strpos( $_POST['user_login'], '@') ) {285 } elseif ( is_email( $_POST['user_login'] ) ) { 286 286 $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) ); 287 287 if ( empty( $user_data ) ) 288 288 $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));