[wp-trac] [WordPress Trac] #34437: The image_downsize filter in wp_prepare_attachment_for_js throws an undefined offset notice.

WordPress Trac noreply at wordpress.org
Sun Oct 25 04:04:18 UTC 2015


#34437: The image_downsize filter in wp_prepare_attachment_for_js throws an
undefined offset notice.
--------------------------+-----------------------------
 Reporter:  justinbusa    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.3.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The following code in the wp_prepare_attachment_for_js function throws  an
 undefined offset notice...


 {{{
 if ( $downsize = apply_filters( 'image_downsize', false, $attachment->ID,
 $size ) ) {
     if ( ! $downsize[3] )
         continue;
 }}}

 When isset is added, the noticed goes away...

 {{{
 if ( $downsize = apply_filters( 'image_downsize', false, $attachment->ID,
 $size ) ) {
     if ( ! isset( $downsize[3] ) )
         continue;
 }}}

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


More information about the wp-trac mailing list