[wp-trac] [WordPress Trac] #25649: Warning in wp-admin/includes/images.php

WordPress Trac noreply at wordpress.org
Mon Oct 28 16:41:27 UTC 2013


#25649: Warning in wp-admin/includes/images.php
------------------------------+------------------
 Reporter:  asakurayoh        |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  3.8
Component:  Warnings/Notices  |     Version:  3.6
 Severity:  normal            |  Resolution:
 Keywords:                    |
------------------------------+------------------
Changes (by SergeyBiryukov):

 * version:  trunk => 3.6
 * milestone:  Awaiting Review => 3.8


Comment:

 The issue here is not a non-existent array key, it's that `$metadata`
 isn't always an array.

 I can reproduce the warning by calling `wp_generate_attachment_metadata()`
 for an audio or video attachment that doesn't exist in the local
 filesystem.

 Both `wp_read_video_metadata()` and `wp_read_audio_metadata()` return
 false in that case:
 [source:tags/3.7/src/wp-admin/includes/media.php#L2615]
 [source:tags/3.7/src/wp-admin/includes/image.php#L121]

 And that causes the warning:
 {{{
 $metadata = false;
 unset( $metadata['image']['data'] );
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25649#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list