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

Props stevenlinx, aegis123.
Fixes #40931.
Built from https://develop.svn.wordpress.org/trunk@41902


git-svn-id: http://core.svn.wordpress.org/trunk@41736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-10-18 15:09:48 +00:00
parent a859b46e92
commit ac5096d8bd
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@
$meta = wp_get_attachment_metadata( $thumbnail_id );
if ( ! empty( $meta['sizes'] ) ) {
foreach ( $meta['sizes'] as $size => $data ) {
if ( $data['width'] / $data['height'] > $aspect_ratio ) {
if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {
$aspect_ratio = $data['width'] / $data['height'];
$measurements = array( $data['width'], $data['height'] );
$image_size = $size;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-beta2-41901';
$wp_version = '4.9-beta2-41902';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.