[TASK] Use current request object in Maintenance middleware 02/57202/2
authorBenni Mack <benni@typo3.org>
Tue, 12 Jun 2018 12:26:59 +0000 (14:26 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 12 Jun 2018 14:01:24 +0000 (16:01 +0200)
The property `$GLOBALS['TYPO3_REQUEST']` is not needed when inside
a middleware, as the current PSR-7 request object is already available.

Resolves: #85242
Releases: master
Change-Id: Ib5062725dd74990c6a6003b6fcd8a82afb158c0b
Reviewed-on: https://review.typo3.org/57202
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Middleware/MaintenanceMode.php

index 6105a43..49f052c 100644 (file)
@@ -47,7 +47,7 @@ class MaintenanceMode implements MiddlewareInterface
                 $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']
             )
         ) {
-            return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($GLOBALS['TYPO3_REQUEST'], 'This page is temporarily unavailable.');
+            return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.');
         }
         // Continue the regular stack if no maintenance mode is active
         return $handler->handle($request);