alchemy-fr / PHP-dataURI

A PHP dataURI library, RFC 2397 Compliant
Other
59 stars 25 forks source link

Invalid getMimeType for audio/mp3 #21

Open renjithspace opened 4 years ago

renjithspace commented 4 years ago

Code


use DataURI\Parser;

$audio = Parser::parse('data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAA');
$mime = $audio->getMimeType();
echo $mime;

Expected

audio/mp3

Output

audio/mp
nevmerzhitsky commented 1 year ago

Totally the same for the video/mp4 case. The problem is inside the regexp pattern.