Review main Merged

72314[BUGFIX] Avoid Uri->__toString() swallows multi-slash paths

Christian Kuhn CR +2 V +2 Easy +18 −8 updated 11/26/21, 17:55

Commit message

Our PSR-7 Uri implementation has a bug when string
casting an Uri object: Creating a Uri from for instance
'https://example.com//' leads to 'https://example.com/'
when string casting that object. The double slash at the
end is perfectly valid and of course should not be removed.

The fun part is now that we have frontend functional
slug tests that test 'https://website.local//' error
handling and redirect behavior. Due to the old functional
test behavior that had to communicate the Uri through
a PHP process, the above Uri string cast bug has been
triggered. This leads to the situation that the test
looks as if it tested the double-slash, while in fact
it didn't. When changing v11 from php-forking based
frontend site test handling to sub request handling,
we actively implemented this behavior in testing-framework
to stay compatible.

In order to drop that hack from testing-framework,
the patch now:

* Fixes the bug in Uri
* Adds a unit test to verify (string)Uri is ok
* Adds a @todo to SlugSiteRequestTest to look at the
  actual 'https://website.local//' behavior with a
  dedicated patch.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 1117

  1. Christian Kuhn uploaded patch set 1 11/26/21, 14:59

  2. core-ci voted on patch set 1 V +1 11/26/21, 15:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19797

  3. Christian Kuhn commented on patch set 1 11/26/21, 15:44

    Uri.php:591

    str_begins_with()
  4. core-ci voted on patch set 1 V -1 11/26/21, 16:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19799

  5. Christian Kuhn uploaded patch set 2 11/26/21, 16:16

  6. Christian Kuhn updated the commit message in patch set 3 11/26/21, 16:20

  7. Christian Kuhn commented on patch set 3 11/26/21, 16:20

    Uri.php:591 Reply

    Done
  8. Christian Kuhn updated the commit message in patch set 4 11/26/21, 16:22

  9. core-ci voted on patch set 2 V -1 11/26/21, 16:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19806

  10. Christian Kuhn uploaded patch set 5 11/26/21, 16:40

  11. core-ci voted on patch set 4 V -1 11/26/21, 16:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19810

  12. core-ci voted on patch set 1 V +1 11/26/21, 16:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19799

  13. core-ci voted on patch set 5 V +1 11/26/21, 16:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19815

  14. Stefan Bürk voted on patch set 5 V +1 CR +1 11/26/21, 16:54

  15. Oli Bartsch voted on patch set 5 V +1 CR +1 11/26/21, 17:50

  16. Christian Kuhn voted on patch set 5 V +2 CR +2 11/26/21, 17:55

  17. Christian Kuhn merged patch set 6 11/26/21, 17:55