[wp-trac] [WordPress Trac] #58535: Undefined array key "file" in function wp_calculate_image_srcset()

WordPress Trac noreply at wordpress.org
Wed Oct 30 21:35:31 UTC 2024


#58535: Undefined array key "file" in function wp_calculate_image_srcset()
--------------------------+-----------------------------
 Reporter:  martinjhenne  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------------

Comment (by jeremyfelt):

 I should have noted that I'm seeing this error in
 `wp_image_add_srcset_and_sizes()`, specifically here:

 {{{
 // Bail early if an image has been inserted and later edited.
 if ( preg_match( '/-e[0-9]{13}/', $image_meta['file'], $img_edit_hash )
         && ! str_contains( wp_basename( $image_src ), $img_edit_hash[0] )
 ) {
         return $image;
 }
 }}}

 I think there's a chance it's happening in more than one place with PDFs,
 though I think there's a general root cause.

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


More information about the wp-trac mailing list