[wp-trac] [WordPress Trac] #40931: Warning: Division by zero in wp-includes/theme-compat/embed-content.php on line 33

WordPress Trac noreply at wordpress.org
Tue Jun 6 13:03:34 UTC 2017


#40931: Warning: Division by zero in wp-includes/theme-compat/embed-content.php on
line 33
--------------------------+-----------------------------
 Reporter:  aegis123      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:  4.7.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When embedding a post in another post I get the warning Warning: Division
 by zero in wp-includes/theme-compat/embed-content.php on line 33. It does
 show a embedded preview image of the post image.

 {{{#!php
 if ( $data['width'] / $data['height'] > $aspect_ratio )
 }}}

 When change this to also check if width and height are larger than 0 the
 warnings go away.

 {{{#!php
 if ( ($data['width'] > 0 && $data['height'] > 0) && $data['width'] /
 $data['height'] > $aspect_ratio ) {
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40931>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list