[wp-trac] [WordPress Trac] #15341: current_user_can needs to be more defensive

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 9 00:40:03 UTC 2010


#15341: current_user_can needs to be more defensive
-------------------------------+--------------------------------------------
 Reporter:  OS1                |        Owner:                 
     Type:  defect (bug)       |       Status:  closed         
 Priority:  normal             |    Milestone:  Awaiting Review
Component:  Warnings/Notices   |      Version:  3.0.1          
 Severity:  normal             |   Resolution:  invalid        
 Keywords:  reporter-feedback  |  
-------------------------------+--------------------------------------------
Changes (by nacin):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 Don't think this is an issue with WordPress. Usually developers see issues
 like current_user_can() being called before init. In this case the
 $current_user object is being scrambled.

 WP_Error::has_cap -> clearly this should be a WP_User object, i.e.
 WP_User::has_cap. I can't see an instance where WordPress would ever
 assign a WP_Error object to $current_user, so it's something in your code.

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


More information about the wp-trac mailing list