Ticket #8938: wp-auth-2.diff
| File wp-auth-2.diff, 1.8 KB (added by , 17 years ago) |
|---|
-
wp-includes/pluggable.php
426 426 427 427 $user = apply_filters('authenticate', null, $username, $password); 428 428 429 if ( ($user == null ) ) { 430 // TODO slight hack to handle initial load of wp-login.php 431 if ( empty($username) && empty($password) && ($GLOBALS['pagenow'] == 'wp-login.php' ) ) { 432 $user = new WP_Error('',''); //No Error 433 } else { 429 if ( $user == null ) { 434 430 // TODO what should the error message be? (Or would these even happen?) 435 431 // Only needed if all authentication handlers fail to return anything. 436 432 $user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.')); 437 }438 433 } 439 434 440 435 if (is_wp_error($user)) { -
wp-includes/user.php
50 50 51 51 $user = wp_authenticate($credentials['user_login'], $credentials['user_password']); 52 52 53 if ( is_wp_error($user) ) 53 if ( is_wp_error($user) ) { 54 if ( $user->get_error_codes() == array('empty_username', 'empty_password') ) { 55 $user = new WP_Error('', ''); 56 } 57 54 58 return $user; 59 } 55 60 56 61 wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie); 57 62 do_action('wp_login', $credentials['user_login']); … … 66 71 function wp_authenticate_username_password($user, $username, $password) { 67 72 if ( is_a($user, 'WP_User') ) { return $user; } 68 73 69 // TODO slight hack to handle initial load of wp-login.php70 if ( (empty($username) && empty($password)) && $GLOBALS['pagenow'] == 'wp-login.php' ) {71 return $user;72 }73 74 74 if ( empty($username) || empty($password) ) { 75 75 $error = new WP_Error(); 76 76