Review main Merged

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

Torben Hansen CR +2 V +2 Normal +122 −48 updated 07/06/23, 07:11

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
    • Oli Bartsch +1
    • Thomas Hohn +1
    • Markus Klein +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1418

  1. Torben Hansen uploaded patch set 1 07/04/23, 17:28

  2. core-ci voted on patch set 1 V +1 07/04/23, 17:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43411

  3. Benni Mack commented on patch set 1 07/04/23, 17:59

    PageContentErrorHandler.php:83

    since PSR-7 states we are immutable, I think we do not even need to use "clone"
  4. Torben Hansen uploaded patch set 2 V +1 07/04/23, 19:12

  5. Torben Hansen commented on patch set 2 07/04/23, 19:12

    PageContentErrorHandler.php:83 Reply

    Done
  6. core-ci voted on patch set 2 V +1 07/04/23, 19:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43420

  7. Benni Mack voted on patch set 2 CR +1 07/04/23, 20:11

  8. Markus Klein commented on patch set 3 CR +1 V +1 07/05/23, 04:50

    Published edit on patch set 2.
  9. Markus Klein voted on patch set 3 CR +1 07/05/23, 04:50

  10. core-ci voted on patch set 3 V +1 07/05/23, 04:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43453

  11. Torben Hansen updated the commit message in patch set 4 CR +1 V +1 07/05/23, 17:29

  12. core-ci voted on patch set 4 V +1 07/05/23, 17:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43569

  13. Oli Bartsch voted on patch set 4 CR +1 07/05/23, 19:14

  14. Oli Bartsch voted on patch set 4 V +1 07/05/23, 19:30

  15. Markus Klein voted on patch set 4 V +1 CR +1 07/05/23, 19:52

  16. Thomas Hohn voted on patch set 4 CR +1 07/05/23, 19:56

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

  18. Benni Mack merged patch set 5 07/06/23, 07:11