From becb1884b4a141fdc44887db184351b19f692e53 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 30 May 2024 13:13:26 +0200 Subject: [PATCH] Add is_array check before printing data --- lib/experimental/script-modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/script-modules.php b/lib/experimental/script-modules.php index b514e6f16b0ca..7ca14e43d715b 100644 --- a/lib/experimental/script-modules.php +++ b/lib/experimental/script-modules.php @@ -243,7 +243,7 @@ function gutenberg_print_script_module_data(): void { */ $data = apply_filters( "scriptmoduledata_{$module_id}", array() ); - if ( ! empty( $data ) ) { + if ( is_array( $data ) && ! empty( $data ) ) { /* * This data will be printed as JSON inside a script tag like this: *