From 97c3f240341043e8a0063a7ddfa40797c4a1ee19 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 6 May 2024 21:25:15 +0000 Subject: [PATCH] Editor: Check that `attrs` is an array in `WP_Block_Supports::apply_block_supports()`. This prevents a fatal error in `wp_apply_custom_classname_support()`, which expects an array data type for block attributes, and makes sure the block editor can still load if there is a mistake in the attributes of a block. Follow-up to [54498]. Props caercam. Fixes #61151. Built from https://develop.svn.wordpress.org/trunk@58112 git-svn-id: http://core.svn.wordpress.org/trunk@57577 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-block-supports.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-block-supports.php b/wp-includes/class-wp-block-supports.php index afc011803b..c90b5e0c54 100644 --- a/wp-includes/class-wp-block-supports.php +++ b/wp-includes/class-wp-block-supports.php @@ -103,7 +103,7 @@ class WP_Block_Supports { return array(); } - $block_attributes = array_key_exists( 'attrs', self::$block_to_render ) + $block_attributes = array_key_exists( 'attrs', self::$block_to_render ) && is_array( self::$block_to_render['attrs'] ) ? self::$block_to_render['attrs'] : array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1c24044b62..6052ce7797 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58111'; +$wp_version = '6.6-alpha-58112'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.