WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#36303 new defect (bug)

edit_user() will give PHP Notices if user_login is unset on add.

Reported by: gitlost Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.2
Component: Users Keywords:
Focuses: Cc:

Description

If you call edit_user() programmatically to add a user then if $_POST['user_login'] isn't set you'll get multiple PHP Notices of Undefined property: stdClass::$user_login (as well as a WP error message). The attached patch sets it to blank on add if unset (the WP error message will still occur).

Attachments (1)

36303.patch (4.0 KB) - added by gitlost 3 years ago.
Set $user->user_login to blank if adding and no $_POSTuser_login? set.

Download all attachments as: .zip

Change History (1)

@gitlost
3 years ago

Set $user->user_login to blank if adding and no $_POSTuser_login? set.

Note: See TracTickets for help on using tickets.