diff --git a/bundle/DependencyInjection/Compiler/IoStorageAllowListPass.php b/bundle/DependencyInjection/Compiler/IoStorageAllowListPass.php new file mode 100644 index 00000000..c3acaca4 --- /dev/null +++ b/bundle/DependencyInjection/Compiler/IoStorageAllowListPass.php @@ -0,0 +1,34 @@ +getParameter('ezpublish.siteaccess.list') + ); + + foreach ($scopes as $scope) { + if ($container->hasParameter("ezsettings.{$scope}.io.file_storage.file_type_blacklist")) { + $bannedFileTypes = $container->getParameter("ezsettings.{$scope}.io.file_storage.file_type_blacklist"); + $index = array_search('svg', $bannedFileTypes, true); + + if ($index !== false) { + unset($bannedFileTypes[$index]); + $container->setParameter("ezsettings.{$scope}.io.file_storage.file_type_blacklist", array_values($bannedFileTypes)); + } + } + } + } +} diff --git a/bundle/NetgenSiteBundle.php b/bundle/NetgenSiteBundle.php index 4b2d5b4f..c04ea878 100644 --- a/bundle/NetgenSiteBundle.php +++ b/bundle/NetgenSiteBundle.php @@ -17,5 +17,6 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new Compiler\ContentDownloadUrlGeneratorPass()); $container->addCompilerPass(new Compiler\LocationFactoryPass()); $container->addCompilerPass(new Compiler\TwigEnvironmentPass()); + $container->addCompilerPass(new Compiler\IoStorageAllowListPass()); } }