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
This commit is contained in:
youknowriad 2024-01-30 11:10:17 +00:00
parent 24565dc6b7
commit b319401d58
2 changed files with 3 additions and 2 deletions

View File

@ -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() );

View File

@ -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.