[wp-trac] [WordPress Trac] #13905: No sanity check in map_meta_cap caps throws PHP notices

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 10 17:33:36 UTC 2010


#13905: No sanity check in map_meta_cap caps throws PHP notices
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |       Owner:  filosofo 
     Type:  defect (bug)  |      Status:  accepted 
 Priority:  normal        |   Milestone:  3.1      
Component:  Post Types    |     Version:  3.0      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Replying to [comment:7 nacin]:
 > I'm not sure some sanity checks are needed here, such as whether a post
 type object exists after we've already established that the post exists.

 Have we? Maybe that's in the recent changes that I need to refresh
 against, but as of two weeks ago we didn't check that the post exists.


 > They seem fine, though -- but can't we just `break` instead of re-
 indenting everything for most checks?

 Multiple breaks for one case seems like asking for trouble, in that it
 makes the logic harder to follow, more likely to get overlooked in future
 patches, etc.

 I'll refresh the patch.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13905#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list