From 037c82baf4f8e0d4901759efed5a32f9ccd66cb6 Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 4 Feb 2022 13:26:05 +1100 Subject: [PATCH] Explicitly checking for false to safeguard a match at position 0 of $content, which would satisfy the if-statement's condition. (#38505) --- packages/block-library/src/image/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/image/index.php b/packages/block-library/src/image/index.php index 685b2d50117a56..70fa3a0a303793 100644 --- a/packages/block-library/src/image/index.php +++ b/packages/block-library/src/image/index.php @@ -20,7 +20,7 @@ function render_block_core_image( $attributes, $content ) { // which now wraps Image Blocks within innerBlocks. // The data-id attribute is added in a core/gallery `render_block_data` hook. $data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"'; - if ( ! strpos( $content, $data_id_attribute ) ) { + if ( false === strpos( $content, $data_id_attribute ) ) { $content = str_replace( '