[wp-trac] [WordPress Trac] #51865: Add filter to `wp_image_src_get_dimensions`

WordPress Trac noreply at wordpress.org
Tue Feb 2 03:46:50 UTC 2021


#51865: Add filter to `wp_image_src_get_dimensions`
-------------------------------------------------+-------------------------
 Reporter:  joemcgill                            |       Owner:  joemcgill
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.7
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  dev-note                                       |
-------------------------------------------------+-------------------------

Comment (by dd32):

 @joemcgill looks this is causing an increased number of PHP Notices on
 WordPress.org like the following:

 {{{
 Source: GET https://wordpress.org/support/article/settings-writing-screen/

 E_NOTICE: Trying to access array offset on value of type bool in wp-
 includes/media.php:1605
 }}}

 It looks like the removed `wp_image_file_matches_image_meta()` was
 protecting against a fasley `$image_meta` value.

 The callstack is: `the_content, apply_filters('the_content'),
 WP_Hook->apply_filters, wp_filter_content_tags,
 wp_img_tag_add_width_and_height_attr, wp_image_src_get_dimensions`

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


More information about the wp-trac mailing list