From 0f07c161d7f3098464ce0626159782c92c715924 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 28 Jan 2009 22:11:49 +0000 Subject: [PATCH] Don't show the error on normal login page loads. See #8938. git-svn-id: https://develop.svn.wordpress.org/trunk@10455 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 7 ++++++- wp-includes/user.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index ddb746ad0a..0028b8cfad 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -426,10 +426,15 @@ function wp_authenticate($username, $password) { $user = apply_filters('authenticate', null, $username, $password); - if ($user == null) { + 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 { // 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', __('ERROR: Invalid username or incorrect password.')); + } } if (is_wp_error($user)) { diff --git a/wp-includes/user.php b/wp-includes/user.php index d21d5f54ed..3c61ad6ecd 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -66,7 +66,7 @@ add_filter('authenticate', 'wp_authenticate_username_password', 20, 3); function wp_authenticate_username_password($user, $username, $password) { if ( is_a($user, 'WP_User') ) { return $user; } - // XXX slight hack to handle initial load of wp-login.php + // TODO slight hack to handle initial load of wp-login.php if ( (empty($username) && empty($password)) && $GLOBALS['pagenow'] == 'wp-login.php' ) { return $user; }