Ticket #18333: 18333.diff
File 18333.diff, 6.1 KB (added by , 13 years ago) |
---|
-
wp-login.php
171 171 $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.')); 172 172 173 173 if ( strpos($_POST['user_login'], '@') ) { 174 $user_data = get_user_by _email(trim($_POST['user_login']));174 $user_data = get_user_by('email', trim($_POST['user_login'])); 175 175 if ( empty($user_data) ) 176 176 $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.')); 177 177 } else { 178 178 $login = trim($_POST['user_login']); 179 $user_data = get_user databylogin($login);179 $user_data = get_user_by('login', $login); 180 180 } 181 181 182 182 do_action('lostpassword_post'); … … 544 544 // If the user wants ssl but the session is not ssl, force a secure cookie. 545 545 if ( !empty($_POST['log']) && !force_ssl_admin() ) { 546 546 $user_name = sanitize_user($_POST['log']); 547 if ( $user = get_user databylogin($user_name) ) {547 if ( $user = get_user_by('login', $user_name) ) { 548 548 if ( get_user_option('use_ssl', $user->ID) ) { 549 549 $secure_cookie = true; 550 550 force_ssl_admin(true); -
wp-includes/post.php
3395 3395 foreach ( $post_authors as $post_author ) { 3396 3396 //Do we have an author id or an author login? 3397 3397 if ( 0 == intval($post_author) ) { 3398 $post_author = get_user databylogin($post_author);3398 $post_author = get_user_by('login', $post_author); 3399 3399 if ( empty($post_author) ) 3400 3400 continue; 3401 3401 if ( empty($post_author->ID) ) -
wp-includes/pluggable-deprecated.php
36 36 } 37 37 endif; 38 38 39 if ( !function_exists('get_userdatabylogin') ) : 40 /** 41 * Retrieve user info by login name. 42 * 43 * @since 0.71 44 * @deprecated 2.5 45 * @deprecated Use get_user_by('login') 46 * 47 * @param string $user_login User's username 48 * @return bool|object False on failure, User DB row object 49 */ 50 function get_userdatabylogin($user_login) { 51 _deprecated_function( __FUNCTION__, '3.3', "get_user_by('login')" ); 52 return get_user_by('login', $user_login); 53 } 54 endif; 55 56 if ( !function_exists('get_user_by_email') ) : 57 /** 58 * Retrieve user info by email. 59 * 60 * @since 2.5 61 * @deprecated 2.5 62 * @deprecated Use get_user_by('email') 63 * 64 * @param string $email User's email address 65 * @return bool|object False on failure, User DB row object 66 */ 67 function get_user_by_email($email) { 68 _deprecated_function( __FUNCTION__, '3.3', "get_user_by('email')" ); 69 return get_user_by('email', $email); 70 } 71 endif; 72 39 73 if ( !function_exists('wp_setcookie') ) : 40 74 /** 41 75 * Sets a cookie for a user who just logged in. This function is deprecated. … … 54 88 */ 55 89 function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) { 56 90 _deprecated_function( __FUNCTION__, '2.5', 'wp_set_auth_cookie()' ); 57 $user = get_user databylogin($username);91 $user = get_user_by('login', $username); 58 92 wp_set_auth_cookie($user->ID, $remember); 59 93 } 60 94 else : … … 133 167 } 134 168 else : 135 169 _deprecated_function( 'wp_login', '2.5', 'wp_signon()' ); 136 endif; 137 No newline at end of file 170 endif; -
wp-includes/user.php
1296 1296 * @return null|int The user's ID on success, and null on failure. 1297 1297 */ 1298 1298 function username_exists( $username ) { 1299 if ( $user = get_user databylogin($username ) ) {1299 if ( $user = get_user_by('login', $username ) ) { 1300 1300 return $user->ID; 1301 1301 } else { 1302 1302 return null; … … 1313 1313 * @return bool|int The user's ID on success, and false on failure. 1314 1314 */ 1315 1315 function email_exists( $email ) { 1316 if ( $user = get_user_by _email($email) )1316 if ( $user = get_user_by('email', $email) ) 1317 1317 return $user->ID; 1318 1318 1319 1319 return false; -
wp-includes/capabilities.php
469 469 if ( ! empty( $id ) ) 470 470 $this->data = get_userdata( $id ); 471 471 else 472 $this->data = get_user databylogin($name );472 $this->data = get_user_by('login', $name ); 473 473 474 474 if ( empty( $this->data->ID ) ) 475 475 return; -
wp-includes/pluggable.php
594 594 return false; 595 595 } 596 596 597 $user = get_user databylogin($username);597 $user = get_user_by('login', $username); 598 598 if ( ! $user ) { 599 599 do_action('auth_cookie_bad_username', $cookie_elements); 600 600 return false; -
wp-mail.php
113 113 $author = sanitize_email($author); 114 114 if ( is_email($author) ) { 115 115 echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; 116 $userdata = get_user_by _email($author);116 $userdata = get_user_by('email', $author); 117 117 if ( empty($userdata) ) { 118 118 $author_found = false; 119 119 } else { -
wp-admin/includes/schema.php
645 645 if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) 646 646 $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); 647 647 648 $site_user = get_user_by _email($email );648 $site_user = get_user_by( 'email', $email ); 649 649 if ( ! is_email( $email ) ) 650 650 $errors->add( 'invalid_email', __( 'You must provide a valid e-mail address.' ) ); 651 651