From b319401d5807a36ffc275cfc6c1ac1affdd0ac17 Mon Sep 17 00:00:00 2001 From: youknowriad Date: Tue, 30 Jan 2024 11:10:17 +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. Built from https://develop.svn.wordpress.org/trunk@57383 git-svn-id: http://core.svn.wordpress.org/trunk@56889 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-supports/layout.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/block-supports/layout.php b/wp-includes/block-supports/layout.php index 4da4f24b23..f5acd75a72 100644 --- a/wp-includes/block-supports/layout.php +++ b/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() ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2e40280f81..26e18a511c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57382'; +$wp_version = '6.5-alpha-57383'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.