Much better handling of wp-login.php page load. See #8938 props wnorris.

git-svn-id: https://develop.svn.wordpress.org/trunk@10463 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2009-01-29 21:30:16 +00:00
parent 366a05425d
commit 8aa657443e
2 changed files with 7 additions and 12 deletions

View File

@@ -426,15 +426,10 @@ function wp_authenticate($username, $password) {
$user = apply_filters('authenticate', null, $username, $password);
if ( ($user == null ) ) {
// TODO slight hack to handle initial load of wp-login.php
if ( empty($username) && empty($password) && ($GLOBALS['pagenow'] == 'wp-login.php' ) ) {
$user = new WP_Error('',''); //No Error
} else {
if ( $user == null ) {
// TODO what should the error message be? (Or would these even happen?)
// Only needed if all authentication handlers fail to return anything.
$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
}
}
if (is_wp_error($user)) {