Skip to content

Commit

Permalink
Adding an is_array check before using count in case $footnotes is not…
Browse files Browse the repository at this point in the history
… countable (#53660)
  • Loading branch information
ramonjd committed Aug 15, 2023
1 parent 75d626c commit 433673c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function render_block_core_footnotes( $attributes, $content, $block ) {

$footnotes = json_decode( $footnotes, true );

if ( count( $footnotes ) === 0 ) {
if ( ! is_array( $footnotes ) || count( $footnotes ) === 0 ) {
return '';
}

Expand Down

0 comments on commit 433673c

Please sign in to comment.