[wp-trac] [WordPress Trac] #46544: mp3 file with different file mime type and content type when uploading should not be rejected
WordPress Trac
noreply at wordpress.org
Sun Mar 17 02:51:33 UTC 2019
#46544: mp3 file with different file mime type and content type when uploading
should not be rejected
--------------------------+-----------------------------------------
Reporter: soleo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 5.1
Severity: major | Keywords: needs-patch has-screenshots
Focuses: |
--------------------------+-----------------------------------------
{{{#!php
<?php
$files = [
'recording6021333337014136895.mp3',
'SampleAudio_0.7mb.mp3',
'to_test_on_timby_voice_note.m4a'
];
if ( extension_loaded( 'fileinfo' ) ) {
foreach ($files as $file ) {
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$real_mime = finfo_file( $finfo, $file );
finfo_close( $finfo );
echo "$file $real_mime\r\n";
}
}
}}}
Results:
recording6021333337014136895.mp3 video/mp4
SampleAudio_0.7mb.mp3 audio/mpeg
to_test_on_timby_voice_note.m4a application/octet-stream
All the files are valid, but `recording6021333337014136895.mp3` and
`to_test_on_timby_voice_note.m4a ` because of the mime type.
https://github.com/WordPress/WordPress/commit/3af00578e46efa3b59fb8ed9f4177d632a123a2e
is the commit which introduces this issue
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46544>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list