diff --git a/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelDataPersister.php b/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelDataPersister.php index 1a5183e148aec15c7e31794aa09959210d1b8219..b14a32582b631de0d5374b9f9a65931d171070b5 100644 --- a/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelDataPersister.php +++ b/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelDataPersister.php @@ -23,7 +23,6 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Adminpanel\Controller\MainController; use TYPO3\CMS\Adminpanel\Utility\StateUtility; -use TYPO3\CMS\Core\Http\NullResponse; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -44,9 +43,7 @@ class AdminPanelDataPersister implements MiddlewareInterface { $response = $handler->handle($request); if ( - !($response instanceof NullResponse) - && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController - && $GLOBALS['TSFE']->isOutputting(true) + $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript() && !StateUtility::isHiddenForUser() diff --git a/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelRenderer.php b/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelRenderer.php index 83ac61c71b688dbcc82f63d3d239a1841cc5a1ab..cba62fc431cc56a4395e500b44653bbf1c61fad7 100644 --- a/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelRenderer.php +++ b/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelRenderer.php @@ -23,7 +23,6 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Adminpanel\Controller\MainController; use TYPO3\CMS\Adminpanel\Utility\StateUtility; -use TYPO3\CMS\Core\Http\NullResponse; use TYPO3\CMS\Core\Http\Stream; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -46,9 +45,7 @@ class AdminPanelRenderer implements MiddlewareInterface { $response = $handler->handle($request); if ( - !($response instanceof NullResponse) - && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController - && $GLOBALS['TSFE']->isOutputting(true) + $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && StateUtility::isActivatedForUser() && StateUtility::isActivatedInTypoScript() && !StateUtility::isHiddenForUser() diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst index 8e8cced33dff5b3b184638e3b6632f2e00ab6ca4..b0c1750cf90000672338ce44dcfe6bd2c055b423 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst @@ -20,6 +20,10 @@ The following PHP class aliases that have been previously deprecated for v10 hav The following PHP class methods that have been previously deprecated for v10 have been removed: - :php:`\TYPO3\CMS\Extbase\Mvc\Controller\ActionController->emitBeforeCallActionMethodSignal` +- :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->isOutputting` +- :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->processContentForOutput` +- :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->settingLocale` + The following PHP static class methods that have been previously deprecated for v10 have been removed: @@ -93,6 +97,13 @@ The following global variables have been removed: The following hooks have been removed: +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace']` + + The following hooks don't pass the class reference anymore: The following signals have been removed: diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 64663a7b81748f40d3af53f3f7a12113b9a86be2..25c6d6f0522c08fd972cef062b0384a265cafde5 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -48,7 +48,6 @@ use TYPO3\CMS\Core\Exception\Page\RootLineException; use TYPO3\CMS\Core\Http\ImmediateResponseException; use TYPO3\CMS\Core\Http\ServerRequestFactory; use TYPO3\CMS\Core\Localization\LanguageService; -use TYPO3\CMS\Core\Localization\Locales; use TYPO3\CMS\Core\Locking\Exception\LockAcquireWouldBlockException; use TYPO3\CMS\Core\Locking\LockFactory; use TYPO3\CMS\Core\Locking\LockingStrategyInterface; @@ -2320,18 +2319,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface $this->tmpl->updateRootlineData($this->rootLine); } - /** - * Setting locale for frontend rendering - * @deprecated will be removed in TYPO3 v11.0. Use Locales::setSystemLocaleFromSiteLanguage() instead. - */ - public function settingLocale() - { - trigger_error('TSFE->settingLocale() will be removed in TYPO3 v11.0. Use Locales::setSystemLocaleFromSiteLanguage() instead, as this functionality is independent of TSFE.', E_USER_DEPRECATED); - if ($this->language->getLocale() && !Locales::setSystemLocaleFromSiteLanguage($this->language)) { - $this->getTimeTracker()->setTSlogMessage('Locale "' . htmlspecialchars($this->language->getLocale()) . '" not found.', 3); - } - } - /** * Checks whether a translated shortcut page has a different shortcut * target than the original language page. @@ -2861,19 +2848,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface GeneralUtility::callUserFunction($_funcRef, $_params, $this); } } - // Convert char-set for output: (should be BEFORE indexing of the content (changed 22/4 2005)), - // because otherwise indexed search might convert from the wrong charset! - // One thing is that the charset mentioned in the HTML header would be wrong since the output charset (metaCharset) - // has not been converted to from utf-8. And indexed search will internally convert from metaCharset - // to utf-8 so the content MUST be in metaCharset already! + // Convert charset for output. Any hooks before (including indexed search) will have to convert from UTF-8 to the target + // charset as well. $this->content = $this->convOutputCharset($this->content); - // Hook for indexing pages - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'])) { - trigger_error('The hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][pageIndexing] will be removed in TYPO3 v11.0. Use the contentPostProc-all hook and convert the content if the output charset does not match the internal format.', E_USER_DEPRECATED); - } - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] ?? [] as $className) { - GeneralUtility::makeInstance($className)->hook_indexContent($this); - } // Storing for cache: if (!$this->no_cache) { $this->realPageCacheContent(); @@ -3171,83 +3148,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface return !empty($this->config['INTincScript']) && is_array($this->config['INTincScript']); } - /******************************************** - * - * Finished off; outputting, storing session data, statistics... - * - *******************************************/ - /** - * Determines if content should be outputted. - * Outputting content is done only if no URL handler is active and no hook disables the output. - * - * @param bool $isCoreCall if set to "true" no deprecation warning will be triggered, because TYPO3 keeps calling this method to keep backwards-compatibility - * @return bool Returns TRUE if no redirect URL is set and no hook disables the output. - * @deprecated will be removed in TYPO3 v11.0. Do not call this method anymore. - */ - public function isOutputting(bool $isCoreCall = false) - { - if ($isCoreCall !== true) { - trigger_error('TypoScriptFrontendController->isOutputting will be removed in TYPO3 v11.0, do not depend on this method anymore. Definition of outputting can be configured via PSR-15 middlewares.', E_USER_DEPRECATED); - } - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'])) { - trigger_error('The hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][isOutputting] will be removed in TYPO3 v11.0. This hook has various side-effects (as the method is called multiple times during one request) and the configuration if TYPO3 is outputting the content is handled via the Emitter / PSR-15 middlewares.', E_USER_DEPRECATED); - } - // Initialize by status if there is a Redirect URL - $enableOutput = true; - // Call hook for possible disabling of output: - $_params = ['pObj' => &$this, 'enableOutput' => &$enableOutput]; - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'] ?? [] as $_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); - } - return $enableOutput; - } - - /** - * Process the output before it's actually outputted. - * - * This includes substituting the "username" comment. - * Works on $this->content. - * - * @param bool $isCoreCall if set to "true" no deprecation warning will be triggered, because TYPO3 keeps calling this method to keep backwards-compatibility - * @deprecated this method will be removed in TYPO3 v11. Use a PSR-15 middleware for processing content. - */ - public function processContentForOutput(bool $isCoreCall = false) - { - if ($isCoreCall !== true) { - trigger_error('TypoScriptFrontendController->processContentForOutput will be removed in TYPO3 v11.0, do not depend on this method anymore. Definition of outputting can be configured via PSR-15 middlewares.', E_USER_DEPRECATED); - } - // Make substitution of eg. username/uid in content only if cache-headers for client/proxy caching is NOT sent! - if (!$this->isClientCachable) { - // Substitute various tokens in content. This should happen only if the content is not cached by proxies or client browsers. - $search = []; - $replace = []; - // Hook for supplying custom search/replace data - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'])) { - trigger_error('The hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][tslib_fe-contentStrReplace] will be removed in TYPO3 v11.0. Use a custom PSR-15 middleware instead.', E_USER_DEPRECATED); - } - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'] ?? [] as $_funcRef) { - $_params = [ - 'search' => &$search, - 'replace' => &$replace - ]; - GeneralUtility::callUserFunction($_funcRef, $_params, $this); - } - if (!empty($search)) { - $this->content = str_replace($search, $replace, $this->content); - } - } - // Hook for supplying custom search/replace data - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'])) { - trigger_error('The hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][contentPostProc-output] will be removed in TYPO3 v11.0. Use a custom PSR-15 middleware instead.', E_USER_DEPRECATED); - } - - // Hook for post-processing of page content before output: - $_params = ['pObj' => &$this]; - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] ?? [] as $_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $this); - } - } - /** * Add HTTP headers to the response object. * diff --git a/typo3/sysext/frontend/Classes/Http/RequestHandler.php b/typo3/sysext/frontend/Classes/Http/RequestHandler.php index cb81fa6b19d0cadd64edb1be39db28f6990ad272..e7bd80ddcddfa914e4d914b094195d9e0066dabc 100644 --- a/typo3/sysext/frontend/Classes/Http/RequestHandler.php +++ b/typo3/sysext/frontend/Classes/Http/RequestHandler.php @@ -22,7 +22,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Http\NullResponse; use TYPO3\CMS\Core\Http\Response; use TYPO3\CMS\Core\Information\Typo3Information; use TYPO3\CMS\Core\Localization\LanguageService; @@ -151,35 +150,12 @@ class RequestHandler implements RequestHandlerInterface $this->timeTracker->pull(); } - // Create a Response object when sending content + // Create a default Response object and add headers and body to it $response = new Response(); - - // Output content - // The if() condition can be removed in TYPO3 v11, which means that TYPO3 will not return a NullResponse - // by default anymore, which it hasn't done without any extensions anyway already. - $isOutputting = $controller->isOutputting(true); - if ($isOutputting) { - $this->timeTracker->push('Print Content'); - $response = $controller->applyHttpHeadersToResponse($response); - $controller->processContentForOutput(true); - $this->timeTracker->pull(); - } - - // Hook for "end-of-frontend" - $_params = ['pObj' => &$controller]; - if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'])) { - trigger_error('The hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][hook_eofe] will be removed in TYPO3 v11.0. The same functionality can be achieved by using a PSR-15 middleware.', E_USER_DEPRECATED); - } - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] ?? [] as $_funcRef) { - GeneralUtility::callUserFunction($_funcRef, $_params, $controller); - } + $response = $controller->applyHttpHeadersToResponse($response); $this->displayPreviewInfoMessage($controller); - - if ($isOutputting) { - $response->getBody()->write($controller->content); - return $response; - } - return new NullResponse(); + $response->getBody()->write($controller->content); + return $response; } /** diff --git a/typo3/sysext/frontend/Classes/Middleware/ContentLengthResponseHeader.php b/typo3/sysext/frontend/Classes/Middleware/ContentLengthResponseHeader.php index 28adee5eea13ddb7ba249ea9f474ee4b8d6391dc..a5b96a99418e19f3cf4d3b265c81086a6b669878 100644 --- a/typo3/sysext/frontend/Classes/Middleware/ContentLengthResponseHeader.php +++ b/typo3/sysext/frontend/Classes/Middleware/ContentLengthResponseHeader.php @@ -21,7 +21,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; -use TYPO3\CMS\Core\Http\NullResponse; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** @@ -45,10 +44,7 @@ class ContentLengthResponseHeader implements MiddlewareInterface public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); - if ( - !($response instanceof NullResponse) - && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController - && $GLOBALS['TSFE']->isOutputting(true)) { + if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { if ( (!isset($GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) || $GLOBALS['TSFE']->config['config']['enableContentLengthHeader']) && !$GLOBALS['TSFE']->isBackendUserLoggedIn() && !$GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php index dedc494346d13af6b3637e8cc3eb032494012dee..0134503910bdef40e9eb36284fdd2d4bfd251855 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php @@ -395,26 +395,31 @@ return [ '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'pageIndexing\']' => [ 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'isOutputting\']' => [ 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'tslib_fe-contentStrReplace\']' => [ 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'contentPostProc-output\']' => [ 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'hook_eofe\']' => [ 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], '$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXT\'][\'runtimeActivatedPackages\']' => [ diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index aa945e54ff6b866ee67dac71845c538d9c0d3253..6b502c80c8d011ed207bad57ea37cbd30483ae08 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -4151,7 +4151,8 @@ return [ 'numberOfMandatoryArguments' => 0, 'maximumNumberOfArguments' => 0, 'restFiles' => [ - 'Deprecation-88473-TypoScriptFrontendController-settingLocale.rst' + 'Deprecation-88473-TypoScriptFrontendController-settingLocale.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], 'TYPO3\CMS\Core\Database\SoftReferenceIndex->findRef_images' => [ @@ -4490,6 +4491,7 @@ return [ 'maximumNumberOfArguments' => 0, 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], 'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->processContentForOutput' => [ @@ -4497,6 +4499,7 @@ return [ 'maximumNumberOfArguments' => 0, 'restFiles' => [ 'Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.rst', + 'Breaking-91473-DeprecatedFunctionalityRemoved.rst' ], ], ]; diff --git a/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php b/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php index adc07884c43e299ed8b5e0904e0b29e973afb75b..44e8df9b90a81cf18da78d1332e83dad45a2be0b 100644 --- a/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php +++ b/typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php @@ -121,7 +121,7 @@ class WorkspacePreview implements MiddlewareInterface } // Add an info box to the frontend content - if ($GLOBALS['TSFE']->doWorkspacePreview() && $GLOBALS['TSFE']->isOutputting(true)) { + if ($GLOBALS['TSFE']->doWorkspacePreview()) { $previewInfo = $this->renderPreviewInfo($GLOBALS['TSFE'], $request->getAttribute('normalizedParams')); $body = $response->getBody(); $body->rewind();