Review 11.5 Merged

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

Benni Mack CR +2 V +2 Normal +146 −50 updated 07/08/23, 11:27

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
    • Thomas Hohn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 912

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

    Cherry Picked from branch 12.4. The following files contain Git conflicts: * typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php * typo3/sysext/felogin/Classes/Controller/LoginController.php * typo3/sysext/felogin/Classes/Redirect/RedirectHandler.php
  2. core-ci voted on patch set 1 V -1 07/06/23, 07:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43663

  3. Torben Hansen uploaded patch set 2 V -1 07/06/23, 08:34

  4. Torben Hansen uploaded patch set 3 07/06/23, 08:36

  5. core-ci voted on patch set 3 V -1 07/06/23, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43670

  6. Torben Hansen uploaded patch set 4 V -1 07/07/23, 07:49

  7. core-ci voted on patch set 4 V +1 07/07/23, 07:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43859

  8. Benni Mack marked it ready for review 07/07/23, 08:52

  9. Thomas Hohn voted on patch set 4 CR +1 07/07/23, 09:10

  10. Oliver Klee voted on patch set 4 V +1 07/07/23, 09:14

  11. Benni Mack voted on patch set 4 V +2 CR +2 07/08/23, 11:27

  12. Benni Mack merged patch set 5 07/08/23, 11:27