getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean(); /** @var Response $response */ $response = GeneralUtility::makeInstance(Response::class); if (empty($eID) || !isset($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID])) { return $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)) { /** @var Dispatcher $dispatcher */ $dispatcher = GeneralUtility::makeInstance(Dispatcher::class); $request = $request->withAttribute('target', $configuration); return $dispatcher->dispatch($request, $response) ?? 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(); } }