[BUGFIX] Respect sub-requests in HTTP referrer redirect URL evaluation
With #99920 the HTTP referrer evaluation has been extended to not overwrite the evaluated HTTP referrer on failed logins. The fix however broke the HTTP referrer evaluation, when the login plugin is placed on a page which is configured as 403 error page. In this case, the page is called via sub-request and a possible available HTTP referrer from the initiating request is used as redirect url. This patch extends the HTTP referrer evaluation, so the URL of the initiating request is used as HTTP referrer variable, if the plugin is called via sub-request. This ensures, that the user is redirected to the URL which the 403 error handler intercepted. In order to do so, the `PageContentErrorHandler` is extended to pass the original request as request attribute `originalRequest` to the sub-request. Additionally, the evaluation of the referrer URL has been moved to `RedirectHandler` and all scenarios have been covered with tests. It has to be noted, that in TYPO3 11.5 the fix will only work, if the "Subrequest page errors" feature toggle is enabled. Resolves: #100715 Releases: main, 12.4, 11.5 Signed-off-by:Torben Hansen <derhansen@gmail.com> Change-Id: Ibcfdf5093eac72f1796d15f40ef9426d0597d7f3 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79785 Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php 5 additions, 3 deletions...lasses/Error/PageErrorHandler/PageContentErrorHandler.php
- typo3/sysext/felogin/Classes/Controller/LoginController.php 1 addition, 45 deletionstypo3/sysext/felogin/Classes/Controller/LoginController.php
- typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php 48 additions, 0 deletionstypo3/sysext/felogin/Classes/Redirect/RedirectHandler.php
- typo3/sysext/felogin/Tests/Unit/Redirect/RedirectHandlerTest.php 68 additions, 0 deletions...ysext/felogin/Tests/Unit/Redirect/RedirectHandlerTest.php
Please register or sign in to comment