[wp-trac] [WordPress Trac] #50543: Media: wp_image_src_get_dimensions() may throw warning or return wrong values

WordPress Trac noreply at wordpress.org
Thu Jul 2 22:51:34 UTC 2020


#50543: Media: wp_image_src_get_dimensions() may throw warning or return wrong
values
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.5
Component:  Media                                |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:   => has-patch needs-testing needs-unit-tests


Comment:

 In 50543.diff:
 - Check if the `$image_meta` is actually the meta data for an image.
 - Check if the relative uploads path plus the file name is at the end of
 the source URL before returning `width` and `height` from `$image_meta`.

 Would also be great to add a unit test or two, perhaps after beta is out
 :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50543#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list