Skip to content

Commit bec0c0d

Browse files
author
Marco Pereirinha
committed
Prevent division by zero error
1 parent ac0d903 commit bec0c0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/class-delivery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ public function parse_element( $element ) {
13051305

13061306
// Check if this is a crop or a scale.
13071307
$has_size = $this->media->get_size_from_url( $this->sanitize_url( $raw_url ) );
1308-
if ( ! empty( $has_size ) ) {
1308+
if ( ! empty( $has_size ) && ! empty( $item['height'] ) ) {
13091309
$file_ratio = round( $has_size[0] / $has_size[1], 2 );
13101310
$original_ratio = round( $item['width'] / $item['height'], 2 );
13111311
if ( $file_ratio !== $original_ratio ) {

0 commit comments

Comments
 (0)