mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 18:24:31 +00:00
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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user