WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20917 closed defect (bug) (fixed)

Illegal offset type in empty() when editing a draft post by another user

Reported by: duck_ Owned by: ryan
Milestone: 3.4 Priority: normal
Severity: major Version: 3.4
Component: Warnings/Notices Keywords: has-patch commit
Focuses: Cc:

Description (last modified by duck_)

Warning: Illegal offset type in isset or empty in wp-includes/capabilities.php on line 885

Triggered by a call to current_user_can() when building the View Post button for the tool bar.

current_user_can( 'read_post', $post_id ) will return an array containing arrays since [21046] for draft posts created by other users because map_meta_cap() returns an array and its result is being put in an array.

Attachments (1)

20917.diff (506 bytes) - added by duck_ 3 years ago.

Download all attachments as: .zip

Change History (5)

@duck_3 years ago

comment:1 @duck_3 years ago

  • Description modified (diff)

comment:2 @nacin3 years ago

  • Keywords commit added
  • Owner set to ryan
  • Severity changed from normal to major
  • Status changed from new to reviewing

Looks good.

comment:3 @ryan3 years ago

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

In [21060]:

Fix warning when processing read_post cap. Props duck_. fixes #20917

comment:4 @markjaquith3 years ago

In [21088]:

Fix warning when processing read_post cap. Props duck_. fixes #20917 for the 3.3 branch.

Note: See TracTickets for help on using tickets.