[wp-trac] [WordPress Trac] #13905: No sanity check in map_meta_cap caps throws PHP notices
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 15 16:29:45 UTC 2010
#13905: No sanity check in map_meta_cap caps throws PHP notices
--------------------------+-------------------------------------------------
Reporter: filosofo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0.1
Component: Post Types | Version: 3.0
Severity: normal | Keywords: has-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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13905>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list