From bf282a5c027c7d61f20949d23152a61026c478c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20Soriano?= Date: Wed, 1 Dec 2021 13:58:56 +0100 Subject: [PATCH] Fix code that causes PHP 8.1 deprecation in BlockTypesController (#5287) --- src/BlockTypesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlockTypesController.php b/src/BlockTypesController.php index b742aa2d94e..dbc38806438 100644 --- a/src/BlockTypesController.php +++ b/src/BlockTypesController.php @@ -76,7 +76,7 @@ public function register_blocks() { */ public function add_data_attributes( $content, $block ) { $block_name = $block['blockName']; - $block_namespace = strtok( $block_name, '/' ); + $block_namespace = strtok( $block_name ?? '', '/' ); /** * Filters the list of allowed block namespaces.