Skip to content

Commit

Permalink
Merge pull request #30 from netlogix/feature/ignore-online-media-reso…
Browse files Browse the repository at this point in the history
…uces
  • Loading branch information
saschanowak authored Oct 22, 2024
2 parents 11a6332 + 89bca06 commit e8d7eff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Classes/EventListener/AddCdnToResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use TYPO3\CMS\Core\Resource\Driver\LocalDriver;
use TYPO3\CMS\Core\Resource\Event\GeneratePublicUrlForResourceEvent;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\OnlineMediaHelperRegistry;
use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Resource\ResourceInterface;
use TYPO3\CMS\Core\Resource\ResourceStorageInterface;
Expand Down Expand Up @@ -53,8 +54,17 @@ public function __invoke(GeneratePublicUrlForResourceEvent $event): void
return;
}

if (($resource->getStorage()->getCapabilities(
) & ResourceStorageInterface::CAPABILITY_PUBLIC) !== ResourceStorageInterface::CAPABILITY_PUBLIC) {
if (
($resource->getStorage()->getCapabilities() & ResourceStorageInterface::CAPABILITY_PUBLIC)
!== ResourceStorageInterface::CAPABILITY_PUBLIC
) {
return;
}

if (
$resource instanceof File &&
GeneralUtility::makeInstance(OnlineMediaHelperRegistry::class)->getOnlineMediaHelper($resource) !== false
) {
return;
}

Expand Down

0 comments on commit e8d7eff

Please sign in to comment.