Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#28019 closed defect (bug) (fixed)

WP_User does not initialise data to a sane value

Reported by: rmccue Owned by: dd32
Priority: normal Milestone: 4.2
Component: Users Version:
Severity: minor Keywords:
Cc: Focuses:

Description (last modified by rmccue)

If I do new WP_User(), I'd expect to be able to do things like $user->user_login = "x" without causing an error. However, the $data property used internally is not initialised to an empty object, causing a "Creating default object from empty value" error.

Change History (3)

#1 @rmccue
12 years ago

  • Description modified (diff)

#2 @dd32
12 years ago

  • Milestone Awaiting Review4.2

#3 @dd32
12 years ago

  • Owner set to dd32
  • Resolutionfixed
  • Status newclosed

In 31049:

Preinitialize WP_User::$data to an object in the event an empty user object is created. Avoids a "Creating default object from empty value" PHP Warning.
Fixes #28019

Note: See TracTickets for help on using tickets.