Make WordPress Core

Changeset 41902


Ignore:
Timestamp:
10/18/2017 03:08:58 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Embeds: Avoid "Division by zero" warning in embed-content.php template if a thumbnail has a zero height.

Props stevenlinx, aegis123.
Fixes #40931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-compat/embed-content.php

    r41565 r41902  
    4040            if ( ! empty( $meta['sizes'] ) ) {
    4141                foreach ( $meta['sizes'] as $size => $data ) {
    42                     if ( $data['width'] / $data['height'] > $aspect_ratio ) {
     42                    if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {
    4343                        $aspect_ratio = $data['width'] / $data['height'];
    4444                        $measurements = array( $data['width'], $data['height'] );
Note: See TracChangeset for help on using the changeset viewer.