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 authored and tellthemachines committed Aug 16, 2023
1 parent 520aad6 commit 0866cce
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 0866cce

Please sign in to comment.