Changeset 3299

Show
Ignore:
Timestamp:
12/13/05 03:46:40 (3 years ago)
Author:
ryan
Message:

If no user is logged in, setup an empty user.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/capabilities.php

    r3297 r3299  
    117117    function WP_User($id) { 
    118118        global $wp_roles, $table_prefix; 
     119 
     120        if ( empty($id) ) 
     121            return; 
    119122 
    120123        if ( is_numeric($id) ) { 
  • trunk/wp-includes/pluggable-functions.php

    r3262 r3299  
    99    global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user; 
    1010 
    11     if ( !isset($_COOKIE[USER_COOKIE]))  
    12         return false; 
    13  
     11    if ( !isset($_COOKIE[USER_COOKIE])) { 
     12        $current_user = new WP_User(0); 
     13        return false; 
     14    } 
    1415    $user_login  = $_COOKIE[USER_COOKIE]; 
    1516    $userdata    = get_userdatabylogin($user_login);