Review 12.4 Merged

79785[BUGFIX] Respect sub-requests in HTTP referrer redirect URL evaluation

Benni Mack CR +2 V +2 Normal +122 −48 updated 07/06/23, 07:33

Commit message

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.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 34

  1. Benni Mack commented on patch set 1 07/06/23, 07:11

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/06/23, 07:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43662

  3. Benni Mack voted on patch set 1 V +2 CR +2 07/06/23, 07:33

  4. Benni Mack merged patch set 2 07/06/23, 07:33