From 8bb6b05d787fe6d8bad71780c3f77a73fc18dad3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Jun 2021 17:04:56 +0000 Subject: [PATCH] Quick/Bulk Edit: Ensure that `$post_ids` variable is initialized ahead of usage. This brings some consistency between similar fragments of `wp-admin/edit.php` and `wp-admin/upload.php`. Follow-up to [51111], [51161]. See #39589, #53411. Built from https://develop.svn.wordpress.org/trunk@51163 git-svn-id: http://core.svn.wordpress.org/trunk@50772 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 4 +++- wp-admin/upload.php | 1 + wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 98ce887af4..e05d3ce195 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -80,6 +80,8 @@ if ( $doaction ) { $sendback = admin_url( $post_new_file ); } + $post_ids = array(); + if ( 'delete_all' === $doaction ) { // Prepare for deletion of all posts with a specified post status (i.e. Empty Trash). $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] ); @@ -96,7 +98,7 @@ if ( $doaction ) { $post_ids = array_map( 'intval', $_REQUEST['post'] ); } - if ( ! isset( $post_ids ) ) { + if ( empty( $post_ids ) ) { wp_redirect( $sendback ); exit; } diff --git a/wp-admin/upload.php b/wp-admin/upload.php index d29914114a..8ea6e1c6d6 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -119,6 +119,7 @@ $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-media' ); + $post_ids = array(); if ( 'delete_all' === $doaction ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 1c7f406487..1948ff352d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta1-51162'; +$wp_version = '5.8-beta1-51163'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.