No sanity check in map_meta_cap caps throws PHP notices
|Reported by:||filosofo||Owned by:||filosofo|
|Component:||Posts, Post Types||Keywords:||needs-patch|
map_meta_cap assumes that the ID which it's passed when evaluating edit_post, edit_page and the like actually belongs to a real post object.
In fact, it's quite possible that the object doesn't yet exist (creating a new object, perhaps) or doesn't exist any more (deleted), or that it has otherwise received a syntactically correct ID value that doesn't map to an existing post object (0, e.g.).
Instead, map_meta_cap should check that the post object actually exists before attempting to branch on its properties.
Patch also removes some apparent debugging comments.
Change History (22)
comment:12 follow-up: ↓ 13 filosofo — 3 years ago
- Milestone Future Release deleted
- Resolution set to wontfix
- Status changed from accepted to closed
comment:16 nacin — 3 years ago
- Milestone set to Future Release
- Resolution wontfix deleted
- Status changed from closed to reopened