vendor/crehler/product-files/src/Subscriber/MediaSubscriber.php line 20

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Crehler\ProductFiles\Subscriber;
  3. use Shopware\Core\Content\Media\Event\MediaFileExtensionWhitelistEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class MediaSubscriber implements EventSubscriberInterface
  6. {
  7.     /**
  8.      * @return array
  9.      */
  10.     public static function getSubscribedEvents(): array
  11.     {
  12.         return [
  13.             MediaFileExtensionWhitelistEvent::class => 'onMediaFileExtensionWhitelist',
  14.         ];
  15.     }
  16.     public function onMediaFileExtensionWhitelist(MediaFileExtensionWhitelistEvent $event)
  17.     {
  18.         $whitelist $event->getWhitelist();
  19.         array_push($whitelist'zip''rar''7zip''docx''sb2''xls');
  20.         $event->setWhitelist($whitelist);
  21.     }
  22. }