From 20399d25ff9c18779b44fa8dd1fb3c10ba714bd4 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 13 May 2020 15:20:42 +0100 Subject: [PATCH] Fix a if condition that could stop a listing page. See CLOUD 409. --- .../php/sync/class-delete-sync.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-delete-sync.php b/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-delete-sync.php index 4a85cc520..0d8c4f817 100644 --- a/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-delete-sync.php +++ b/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-delete-sync.php @@ -65,7 +65,8 @@ public function can_delete_asset( $all_caps, $caps, $args ) { $has_error = $this->plugin->components['media']->get_post_meta( $post_id, Sync::META_KEYS['sync_error'], true ); if ( empty( $has_error ) ) { $all_caps['delete_posts'] = false; - if ( filter_input( INPUT_GET, 'action', FILTER_DEFAULT ) ) { + $action = filter_input( INPUT_GET, 'action', FILTER_SANITIZE_STRING ); + if ( ! empty( $action ) && '-1' !== $action ) { wp_die( esc_html__( 'Sorry, you can’t delete an asset until it has fully synced with Cloudinary. Try again once syncing is complete.', 'cloudinary' ) ); } }