Skip to content

Commit

Permalink
Check that per_page is not zero before using it (#37788)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz authored Jan 10, 2022
1 parent 5d9a7a7 commit c9ba458
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function render_block_core_comments_pagination_next( $attributes, $content, $blo
}
}
$comments_number = (int) get_comments_number();
$max_page = isset( $per_page ) ? (int) floor( $comments_number / $per_page ) : 0;
$max_page = 0 !== $per_page ? (int) floor( $comments_number / $per_page ) : 0;
$default_label = __( 'Next Comments' );
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
$pagination_arrow = get_comments_pagination_arrow( $block, 'next' );
Expand Down

0 comments on commit c9ba458

Please sign in to comment.