Make WordPress Core

Ticket #31097: 31097.patch

File 31097.patch, 435 bytes (added by tyxla, 9 years ago)

Making sure that ID is set before using it.

  • src/wp-includes/user.php

     
    19751975                $userdata = $userdata->to_array();
    19761976        }
    19771977
    1978         $ID = (int) $userdata['ID'];
     1978        $ID = !empty($userdata['ID']) ? absint($userdata['ID']) : 0;
    19791979
    19801980        // First, get all of the original fields
    19811981        $user_obj = get_userdata( $ID );