Ticket #11808 (closed defect (bug): fixed)

Opened 2 years ago

Last modified 2 years ago

is_super_admin() should try to get missing user_id

Reported by: filosofo Owned by: ryan
Priority: normal Milestone: 3.0
Component: Role/Capability Version: 3.0
Severity: normal Keywords: has-patch commit multisite
Cc:

Description

If its user_id argument is missing, is_super_admin() should assume we want the current user's ID and try to get that before returning false.

Attachments

is_super_admin-get_userid.diff Download (714 bytes) - added by filosofo 2 years ago.

Change History

To clarify, instead of checking the global $current_user directly is_super_admin() should rely on the current user API as the functions used are pluggable and thus they might not be setting $current_user in predictable ways.

  • Keywords commit added; is_super_admin removed

Gets my vote.

Changed patch to use ! empty instead of isset since $current_user can get set to false instead of being an object.

comment:4   ryan2 years ago

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.