Make WordPress Core

Ticket #20043: 20043.2.patch

File 20043.2.patch, 517 bytes (added by tyxla, 10 years ago)

WP_User::unset(): blacklisting ID so it can't be unset; setting it to 0 instead.

  • src/wp-includes/class-wp-user.php

     
    348348                        $key = 'ID';
    349349                }
    350350
     351                $unset_blacklist = array(
     352                        'ID' => 0,
     353                );
     354                if ( array_key_exists( $key, $unset_blacklist ) ) {
     355                        $this->data->$key = $unset_blacklist[ $key ];
     356                        return;
     357                }
     358
    351359                if ( isset( $this->data->$key ) ) {
    352360                        unset( $this->data->$key );
    353361                }