PHP-dataURI
PHP-dataURI copied to clipboard
Invalid getMimeType for audio/mp3
Code
use DataURI\Parser;
$audio = Parser::parse('data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAA');
$mime = $audio->getMimeType();
echo $mime;
Expected
audio/mp3
Output
audio/mp
Totally the same for the video/mp4
case. The problem is inside the regexp pattern.