#34599 closed defect (bug) (fixed)
PHP warning in wp-admin/includes/images.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 4.3 |
| Component: | Media | Keywords: | has-patch |
| Focuses: | Cc: |
Attachments (2)
Change History (10)
#2
follow-up:
↓ 3
@
10 years ago
Can this instead be switched to if ( $metadata ) { unset( $metadata['...']['..'] ); }?
Having it do isset() followed by unset() is confusing, but a truthy check makes it far mor explicit that the reason could be because it's false.
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
10 years ago
Replying to dd32:
Can this instead be switched to
if ( $metadata ) { unset( $metadata['...']['..'] ); }?
The array is set, but missing image (and data). Here's a $metadata from an audio/mp3.
array ( 'dataformat' => 'mp3', 'channels' => 2, 'sample_rate' => 48000, 'bitrate' => 128004.24543946931953541934490203857421875, 'channelmode' => 'stereo', 'bitrate_mode' => 'vbr', 'lossless' => false, 'encoder_options' => 'VBR', 'compression_ratio' => 0.08333609729132117338590290955835371278226375579833984375, 'fileformat' => 'mp3', 'filesize' => 11578029, 'mime_type' => 'audio/mpeg', 'length' => 724, 'length_formatted' => '12:04', 'encoder_settings' => 'Lavf56.25.101', )
#4
in reply to:
↑ 3
@
10 years ago
Replying to skithund:
The array is set, but missing
image(anddata). Here's a $metadata from an audio/mp3.
That won't cause a PHP notice or warning under any version of PHP.
What will is when the $metadata value is false as mentioned on the original ticket, and shown here: https://3v4l.org/YNBIg (Note, that the only warning is line 8, and although notices are shown, none are shown for line 4)
#5
@
10 years ago
After more research, this warning was actually triggered by mp2 file, not mp3. Hence $metadata value was indeed false.
Revised patch incoming.
We should probably add a small comment there so it doesn't get removed again.