Skip to content

Commit

Permalink
Avoid division by zero in site logo block (#38808)
Browse files Browse the repository at this point in the history
  • Loading branch information
audrasjb authored and Mamaduka committed Feb 16, 2022
1 parent c7cd9d5 commit f4f9a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/site-logo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
function render_block_core_site_logo( $attributes ) {
$adjust_width_height_filter = function ( $image ) use ( $attributes ) {
if ( empty( $attributes['width'] ) || empty( $image ) ) {
if ( empty( $attributes['width'] ) || empty( $image ) || ! $image[1] || ! $image[2] ) {
return $image;
}
$height = (float) $attributes['width'] / ( (float) $image[1] / (float) $image[2] );
Expand Down

0 comments on commit f4f9a4c

Please sign in to comment.