Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#28004 closed defect (bug) (fixed)

wp_insert_user() updates usermeta table when user ID does not exist

Reported by: bilalcoder's profile bilalcoder Owned by: swissspidy's profile swissspidy
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch has-unit-tests
Focuses: Cc:


wp_insert_user() doesn't care if the user exists in the database when updating.

Attachments (2)

user.diff (487 bytes) - added by bilalcoder 10 years ago.
28004.diff (1.8 KB) - added by swissspidy 9 years ago.

Download all attachments as: .zip

Change History (8)

10 years ago

#1 @SergeyBiryukov
10 years ago

  • Keywords has-patch added

#2 @swissspidy
9 years ago

  • Keywords needs-refresh needs-unit-tests added

Needs a refresh after splitting up the user.php file.

#3 @wonderboymusic
9 years ago

  • Milestone changed from Awaiting Review to 4.4

#4 @SergeyBiryukov
9 years ago

  • Owner set to swissspidy
  • Status changed from new to assigned

9 years ago

#5 @swissspidy
9 years ago

  • Keywords has-unit-tests added; needs-refresh needs-unit-tests removed

28004.diff is an updated patch against trunk that also includes a user test. I updated the error message to use an already existing string.

#6 @wonderboymusic
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35280:

Users: when calling wp_insert_user() with an valid user ID, return WP_Error instead of arbitrarily updating user meta.

Adds unit test.

Props swissspidy, bilalcoder.
Fixes #28004.

Note: See TracTickets for help on using tickets.