Fix for #36715
This commit is contained in:
parent
5c24718b1e
commit
f3005ec653
@ -51,7 +51,7 @@ final class MimeTypes implements MimeTypesInterface
|
||||
$this->extensions[$mimeType] = $extensions;
|
||||
|
||||
foreach ($extensions as $extension) {
|
||||
$this->mimeTypes[$extension] = $mimeType;
|
||||
$this->mimeTypes[$extension][] = $mimeType;
|
||||
}
|
||||
}
|
||||
$this->registerGuesser(new FileBinaryMimeTypeGuesser());
|
||||
|
@ -62,4 +62,15 @@ class MimeTypesTest extends AbstractMimeTypeGuesserTest
|
||||
$this->assertContains('image/svg', $mt->getMimeTypes('svg'));
|
||||
$this->assertSame([], $mt->getMimeTypes('symfony'));
|
||||
}
|
||||
|
||||
public function testCustomMimeTypes()
|
||||
{
|
||||
$mt = new MimeTypes([
|
||||
'text/bar' => ['foo'],
|
||||
'text/baz' => ['foo', 'moof'],
|
||||
]);
|
||||
$this->assertContains('text/bar', $mt->getMimeTypes('foo'));
|
||||
$this->assertContains('text/baz', $mt->getMimeTypes('foo'));
|
||||
$this->assertSame(['foo', 'moof'], $mt->getExtensions('text/baz'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user