From 5466d3a9a72b38039ded378ae0f7331e8ba32a3f Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 30 Jan 2024 11:08:15 +0000 Subject: [PATCH] Editor: Fix PHP warning in Layout block support. strpos was triggering a php warning. This also updates the code to use the now supported str_contains. Props get_dave, dmsnell, ocean90, mukesh27. Fixes #60327. git-svn-id: https://develop.svn.wordpress.org/trunk@57383 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-supports/layout.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/block-supports/layout.php b/src/wp-includes/block-supports/layout.php index 4da4f24b23..f5acd75a72 100644 --- a/src/wp-includes/block-supports/layout.php +++ b/src/wp-includes/block-supports/layout.php @@ -837,7 +837,8 @@ function wp_render_layout_support_flag( $block_content, $block ) { break; } - if ( false !== strpos( $processor->get_attribute( 'class' ), $inner_block_wrapper_classes ) ) { + $class_attribute = $processor->get_attribute( 'class' ); + if ( is_string( $class_attribute ) && str_contains( $class_attribute, $inner_block_wrapper_classes ) ) { break; } } while ( $processor->next_tag() );