From f2f4e21db472774eaa31c04f5cc7446aecde4552 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:27:14 +1100 Subject: [PATCH] Layout: ensure block content is always returned as a string (#45330) --- lib/block-supports/layout.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index b61311362893a..0734936b2610b 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -305,7 +305,7 @@ function gutenberg_get_classnames_from_last_tag( $html ) { $last_classnames = $tags->get_attribute( 'class' ); } - return $last_classnames; + return (string) $last_classnames; } /** @@ -445,7 +445,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { $content->add_class( implode( ' ', $class_names ) ); } - return $content; + return (string) $content; } // Register the block support. (overrides core one).