mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 06:29:30 +00:00
Don't show the error on normal login page loads. See #8938.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9bdf38f5c2
commit
f02590c921
@ -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', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
|
||||
}
|
||||
}
|
||||
|
||||
if (is_wp_error($user)) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user