diff --git a/typo3/sysext/core/Classes/Controller/FileDumpController.php b/typo3/sysext/core/Classes/Controller/FileDumpController.php index be549fec26691e8fc8bc34c684f24d8e1d147ec3..422a15e2e00446312dd44ee3eded0e2bbb3bee6b 100644 --- a/typo3/sysext/core/Classes/Controller/FileDumpController.php +++ b/typo3/sysext/core/Classes/Controller/FileDumpController.php @@ -23,11 +23,9 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; use TYPO3\CMS\Core\Resource\Event\ModifyFileDumpEvent; -use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException; use TYPO3\CMS\Core\Resource\File; use TYPO3\CMS\Core\Resource\FileInterface; use TYPO3\CMS\Core\Resource\FileReference; -use TYPO3\CMS\Core\Resource\Hook\FileDumpEIDHookInterface; use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ProcessedFileRepository; use TYPO3\CMS\Core\Resource\ResourceFactory; @@ -60,7 +58,6 @@ class FileDumpController * @return ResponseInterface * @throws \InvalidArgumentException * @throws \RuntimeException - * @throws FileDoesNotExistException * @throws \UnexpectedValueException */ public function dumpAction(ServerRequestInterface $request): ResponseInterface @@ -75,26 +72,6 @@ class FileDumpController return $this->responseFactory->createResponse(404); } - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'])) { - trigger_error( - 'The hook $TYPO3_CONF_VARS[SC_OPTIONS][FileDumpEID.php][checkFileAccess] is deprecated and will stop working in TYPO3 v12.0. Use the ModifyFileDumpEvent instead.', - E_USER_DEPRECATED - ); - } - - // Hook: allow some other process to do some security/access checks. Hook should return 403 response if access is rejected, void otherwise - // @deprecated: will be removed in TYPO3 v12.0. - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess'] ?? [] as $className) { - $hookObject = GeneralUtility::makeInstance($className); - if (!$hookObject instanceof FileDumpEIDHookInterface) { - throw new \UnexpectedValueException($className . ' must implement interface ' . FileDumpEIDHookInterface::class, 1394442417); - } - $response = $hookObject->checkFileAccess($file); - if ($response instanceof ResponseInterface) { - return $response; - } - } - // Allow some other process to do some security/access checks. // Event Listeners should return a 403 response if access is rejected $event = new ModifyFileDumpEvent($file, $request); diff --git a/typo3/sysext/core/Classes/Resource/Hook/FileDumpEIDHookInterface.php b/typo3/sysext/core/Classes/Resource/Hook/FileDumpEIDHookInterface.php deleted file mode 100644 index 51f9fcb6c86c763ebf6f2a9d58d17d2dc6029e71..0000000000000000000000000000000000000000 --- a/typo3/sysext/core/Classes/Resource/Hook/FileDumpEIDHookInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Core\Resource\Hook; - -use Psr\Http\Message\ResponseInterface; -use TYPO3\CMS\Core\Resource\ResourceInterface; - -/** - * Interface for FileDumpEID Hook to perform some custom security/access checks - * when accessing file thought FileDumpEID - * @deprecated since TYPO3 v11 LTS, will be removed in TYPO3 v12.0. Use the PSR-14-based ModifyFileDumpEvent instead. - */ -interface FileDumpEIDHookInterface -{ - /** - * Perform custom security/access when accessing file - * Method should issue 403 if access is rejected - * or 401 if authentication is required via an authorized HTTP authorization scheme. - * A 401 header must be accompanied by a www-authenticate header! - * - * @param \TYPO3\CMS\Core\Resource\ResourceInterface $file - * @return ResponseInterface|null - */ - public function checkFileAccess(ResourceInterface $file); -} diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst index c01c5ada668995f50c57e7b9cbdd33b32f7b482e..dd060944545c4da1d6e539b9f0d3a85559d0e5bb 100644 --- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst @@ -18,7 +18,7 @@ The following PHP classes that have previously been marked as deprecated for v11 The following PHP interfaces that have previously been marked as deprecated for v11 and were now removed: -- :php:`\Full\Class\Name` +- :php:`\TYPO3\CMS\Core\Resource\Hook\FileDumpEIDHookInterface` The following PHP class aliases that have previously been marked as deprecated for v11 and were now removed: @@ -82,7 +82,7 @@ The following global variables have been removed: The following hooks have been removed: -- :php:`$GLOBALS['TYPO3_CONF_VARS']['KEY']['subKey']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess']` The following signals have been removed: diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php index 94c4d805db6323aab75c54465c94784017bb4f84..4e9d07cf27f87c1750f39d5c9a8f1251a08d3dca 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php @@ -510,6 +510,7 @@ return [ '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'FileDumpEID.php\'][\'checkFileAccess\']' => [ 'restFiles' => [ 'Deprecation-95080-FileDumpCheckFileAccessHook.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'t3lib/class.t3lib_extfilefunc.php\'][\'processData\']' => [ diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index d276980fef05d96e0cc44c3daccc91312e48ec38..ebfb217418983f8e89488f031c5c3da60ed4121c 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -1799,6 +1799,7 @@ return [ 'TYPO3\CMS\Core\Resource\Hook\FileDumpEIDHookInterface' => [ 'restFiles' => [ 'Deprecation-95080-FileDumpCheckFileAccessHook.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Core\Utility\File\ExtendedFileUtilityProcessDataHookInterface' => [