[!!!][TASK] Remove deprecated frontend-related hooks and include scripts
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Middleware / EidHandler.php
index dd4c1a3..bf8c568 100644 (file)
@@ -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();
     }
 }