Opened 10 years ago
Last modified 6 years ago
#31199 accepted defect (bug)
Potential reference to unset variable in get_bulk_actions (WP_Posts_List_Table)
Reported by: | sgrant | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
get_post_type_object can return null in some cases, which causes a notice when current_user_can is called later in the function.
Attached a patch to check if delete_posts is set, and to only add actions if it is. Thanks!
Attachments (3)
Change History (8)
#1
@
10 years ago
- Keywords has-patch added
Hi sgrant
Could you please provide a the way you have triggered this bug, so that I can reproduce it ?
And I think you made a mistake in your patch : $post_type_obj->delete_posts
will never exist, its $post_type_obj->cap->delete_posts
that has to be checked.
#3
@
6 years ago
- Keywords reporter-feedback removed
- Milestone changed from Awaiting Review to 5.1
- Owner set to chriscct7
- Status changed from new to accepted
Updated patch with additional checks for edit_posts cap as well as empty post_type_obj variable.
Note: See
TracTickets for help on using
tickets.
Add isset check before referencing