Skip to content

Commit

Permalink
Add is_array check before printing data
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed May 30, 2024
1 parent 2b1e531 commit becb188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/experimental/script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
* <script type="application/json"></script>
Expand Down

0 comments on commit becb188

Please sign in to comment.