X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/blobdiff_plain/31e024cbc2e4804c04fb6ac22c50b52a39986dc2..4ea922d09a270cf0e0e17d66d5a3ebbab8f38c74:/typo3/sysext/frontend/Classes/Middleware/EidHandler.php diff --git a/typo3/sysext/frontend/Classes/Middleware/EidHandler.php b/typo3/sysext/frontend/Classes/Middleware/EidHandler.php index dd4c1a3061f0..bf8c568e9364 100644 --- a/typo3/sysext/frontend/Classes/Middleware/EidHandler.php +++ b/typo3/sysext/frontend/Classes/Middleware/EidHandler.php @@ -53,28 +53,13 @@ class EidHandler implements MiddlewareInterface // Remove any output produced until now ob_clean(); - if (empty($eID) || !isset($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID])) { + $target = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID] ?? null; + if (empty($target)) { return (new Response())->withStatus(404, 'eID not registered'); } - $configuration = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID]; - - // Simple check to make sure that it's not an absolute file (to use the fallback) - if (strpos($configuration, '::') !== false || is_callable($configuration)) { - $dispatcher = GeneralUtility::makeInstance(Dispatcher::class); - $request = $request->withAttribute('target', $configuration); - return $dispatcher->dispatch($request) ?? new NullResponse(); - } - trigger_error( - 'eID "' . $eID . '" is registered with a script to a file. This behaviour will be removed in TYPO3 v10.0.' - . ' Register eID with a class::method syntax like "\MyVendor\MyExtension\Controller\MyEidController::myMethod" instead.', - E_USER_DEPRECATED - ); - $scriptPath = GeneralUtility::getFileAbsFileName($configuration); - if ($scriptPath === '') { - throw new Exception('Registered eID has invalid script path.', 1518042216); - } - include $scriptPath; - return new NullResponse(); + $dispatcher = GeneralUtility::makeInstance(Dispatcher::class); + $request = $request->withAttribute('target', $target); + return $dispatcher->dispatch($request) ?? new NullResponse(); } }