WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/29/2009 09:30:16 PM (11 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r10455 r10463  
    5151    $user = wp_authenticate($credentials['user_login'], $credentials['user_password']);
    5252
    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
    5458        return $user;
     59    }
    5560
    5661    wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie);
     
    6671function wp_authenticate_username_password($user, $username, $password) {
    6772    if ( is_a($user, 'WP_User') ) { return $user; }
    68 
    69     // TODO slight hack to handle initial load of wp-login.php
    70     if ( (empty($username) && empty($password)) && $GLOBALS['pagenow'] == 'wp-login.php' ) {
    71         return $user;
    72     }
    7373
    7474    if ( empty($username) || empty($password) ) {
Note: See TracChangeset for help on using the changeset viewer.