Make WordPress Core

Changeset 10463


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

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r10461 r10463  
    427427    $user = apply_filters('authenticate', null, $username, $password);
    428428
    429     if ( ($user == null ) ) {
    430         // TODO slight hack to handle initial load of wp-login.php
    431         if ( empty($username) && empty($password) && ($GLOBALS['pagenow'] == 'wp-login.php' ) ) {
    432             $user = new WP_Error('',''); //No Error
    433         } else {
     429    if ( $user == null ) {
    434430        // TODO what should the error message be? (Or would these even happen?)
    435431        // Only needed if all authentication handlers fail to return anything.
    436432        $user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
    437         }
    438433    }
    439434
  • 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.