[wp-trac] [WordPress Trac] #39250: Undefinded Variable in Media-Modal

WordPress Trac noreply at wordpress.org
Mon Dec 12 14:53:28 UTC 2016


#39250: Undefinded Variable in Media-Modal
--------------------------+-----------------------------
 Reporter:  arkonisus     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:  ui            |
--------------------------+-----------------------------
 If you try to place some images and open the media-modal you will get the
 following error if there are also PDFs or other filetypes than 'image' in
 the list:

 {{{
 PHP Notice:  Undefined variable: base_url in ... /wp-includes/media.php on
 line 3204
 }}}

 The problem is that the variable was declared inside an IF-clause some
 lines before (line 3172ff.):

 {{{
 } elseif ( isset( $meta['sizes'][ $size ] ) ) {
     if ( ! isset( $base_url ) )
         $base_url = str_replace( wp_basename( $attachment_url ), '',
 $attachment_url );
 }}}

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


More information about the wp-trac mailing list