<?php declare(strict_types=1);
namespace Samson\Subscriber;
/***
*
* This file is part of the "SAMSON Shop" project.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2023
*
***/
use Shopware\Core\Content\Media\Event\MediaFileExtensionWhitelistEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class MediaFileExtensionSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
MediaFileExtensionWhitelistEvent::class => 'addEntryToFileExtensionWhitelist'
];
}
public function addEntryToFileExtensionWhitelist(MediaFileExtensionWhitelistEvent $event): void
{
$whiteList = $event->getWhitelist();
$whiteList[] = 'zip';
$whiteList[] = 'stl';
$whiteList[] = 'bin';
$whiteList[] = 'gltf';
$whiteList[] = 'glb';
$event->setWhitelist($whiteList);
}
}