[BUGFIX] Detect recursions in PageContentErrorHandler 15/58615/3
authorSimon Praetorius <simon@praetorius.me>
Thu, 11 Oct 2018 12:43:09 +0000 (14:43 +0200)
committerBenni Mack <benni@typo3.org>
Sat, 27 Oct 2018 20:23:55 +0000 (22:23 +0200)
Possible recursions that can occur while fetching the content of an error page are now detected and resolved.

Resolves: #86626
Releases: master
Change-Id: I72ca04bd57ac400e14a06231218cee903c713675
Reviewed-on: https://review.typo3.org/58615
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php

index 6d2b275..ce44db5 100644 (file)
@@ -68,7 +68,13 @@ class PageContentErrorHandler implements PageErrorHandlerInterface
     {
         try {
             $resolvedUrl = $this->resolveUrl($request, $this->errorHandlerConfiguration['errorContentSource']);
-            $content = GeneralUtility::getUrl($resolvedUrl);
+            $content = null;
+            if ($resolvedUrl !== (string)$request->getUri()) {
+                $content = GeneralUtility::getUrl($resolvedUrl);
+            }
+            if (!$content) {
+                $content = 'Error handler could not fetch error page: Possible recursion detected.';
+            }
         } catch (InvalidRouteArgumentsException | SiteNotFoundException $e) {
             $content = 'Invalid error handler configuration: ' . $this->errorHandlerConfiguration['errorContentSource'];
         }