[wp-trac] [WordPress Trac] #53411: Incorrect isset check in media bulk actions

WordPress Trac noreply at wordpress.org
Tue Jun 15 16:31:51 UTC 2021


#53411: Incorrect isset check in media bulk actions
------------------------------+---------------------
 Reporter:  david.binda       |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  5.8
Component:  Media             |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------
Changes (by hellofromTonya):

 * keywords:   => has-patch commit


Comment:

 Review summary:

 Yes, @davidbinda is right. The variable is now initialized and set to an
 empty array. This means `isset()` is no longer the appropriate construct.
 The check in this context is for no post IDs, which means checking for an
 empty array. `empty()` is a good guard clause as well as a valid check for
 this context.

 - The patch looks good
 - Manually tested with expected results
 - Tests passing
 - Linting passing

 Marking for commit.

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


More information about the wp-trac mailing list