|
|
@@ -15,25 +15,20 @@ use TYPO3\CMS\Frontend\Page\PageAccessFailureReasons;
|
|
|
|
|
|
class OtPageResolver extends \TYPO3\CMS\Frontend\Middleware\PageResolver
|
|
|
{
|
|
|
- private bool $shallFallback;
|
|
|
-
|
|
|
- public function __construct($controller = null)
|
|
|
- {
|
|
|
- $this->shallFallback = $_COOKIE['optimize'] != 1 && $_SERVER['TYPO3_OPTIMIZE'] != 1;
|
|
|
-
|
|
|
- parent::__construct($controller);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Resolve the page ID
|
|
|
*
|
|
|
* @param ServerRequestInterface $request
|
|
|
* @param RequestHandlerInterface $handler
|
|
|
* @return ResponseInterface
|
|
|
+ * @throws \Opentalent\OtCore\Exception\NoSuchWebsiteException
|
|
|
+ * @throws \TYPO3\CMS\Core\Error\Http\PageNotFoundException
|
|
|
+ * @throws \TYPO3\CMS\Extbase\Object\Exception
|
|
|
*/
|
|
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
|
|
{
|
|
|
- if ($this->shallFallback) {
|
|
|
+ $shallFallback = $_COOKIE['optimize'] != 1 && $_SERVER['TYPO3_OPTIMIZE'] != 1;
|
|
|
+ if ($shallFallback) {
|
|
|
return parent::process($request, $handler);
|
|
|
}
|
|
|
|