WordPress.org

Make WordPress Core

Ticket #18372: pluggable.php.patch

File pluggable.php.patch, 635 bytes (added by MarcusPope, 7 years ago)
  • wp-includes/pluggable.php

     
    783783function is_user_logged_in() {
    784784        $user = wp_get_current_user();
    785785
    786         if ( $user->id == 0 )
     786        if ( !isset($user) || $user->id == 0 )
    787787                return false;
    788788
    789789        return true;
     
    13341334 */
    13351335function wp_create_nonce($action = -1) {
    13361336        $user = wp_get_current_user();
     1337
     1338    if (isset($user)) {
    13371339        $uid = (int) $user->id;
     1340    }
     1341    else {
     1342        $uid = 0;
     1343    }
    13381344
    13391345        $i = wp_nonce_tick();
    13401346