[wp-trac] [WordPress Trac] #44591: PHP notice if optional argument isn't passed to map_meta_cap()

WordPress Trac noreply at wordpress.org
Sun Oct 11 21:16:33 UTC 2020


#44591: PHP notice if optional argument isn't passed to map_meta_cap()
--------------------------+-----------------------------
 Reporter:  henry.wright  |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  5.6
Component:  Users         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by henry.wright):

 using `current_user_can()` with a single argument isn't a developer error
 according to the function definition. it is a developer error to attempt
 to use a non-existing second argument in the function definition though

 in my opinion the developer calling these functions isn't doing it wrong
 but the developer writing the function definition may be doing it wrong
 depending on whether they attempt to access a variable not set

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44591#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list