Review main Merged

88899[TASK] Deprecate GeneralUtility::resolveBackPath

Benni Mack CR +2 V +2 Normal +115 −38 updated 04/28/25, 19:30

Commit message

This method was really important back when
TYPO3 had dozens of entry point files (that is
PHP scripts that were called directly), whereas
the main application nowadays is only executed via
"index.php" in the public webroot. Its usage can
thus be removed.

That means, TYPO3 will not resolve any magic
paths like "../typo3conf/ext/news/Resources/Private/Language/locallang.xlf"
for you anymore to be canonicalized. They can
still be used to reference files like that.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 1

Files 12

Review log 1523

  1. Benni Mack uploaded patch set 1 04/02/25, 07:30

  2. Benni Mack marked it work in progress 04/02/25, 07:30

  3. core-ci voted on patch set 1 V -1 04/02/25, 07:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76845

  4. Benni Mack uploaded patch set 2 V -1 04/09/25, 19:29

  5. core-ci voted on patch set 2 V -1 04/09/25, 19:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77314

  6. Benni Mack uploaded patch set 3 V -1 04/11/25, 15:13

  7. core-ci voted on patch set 3 V +1 04/11/25, 15:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77548

  8. Benni Mack uploaded patch set 4 V +1 04/24/25, 11:42

  9. core-ci voted on patch set 4 V +1 04/24/25, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78121

  10. Benni Mack uploaded patch set 5 V +1 04/25/25, 14:12

  11. Benni Mack marked it ready for review 04/25/25, 14:12

  12. core-ci voted on patch set 5 V +1 04/25/25, 14:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78184

  13. Georg Ringer voted on patch set 5 CR +1 V +1 04/25/25, 19:42

  14. Stefan Bürk commented on patch set 5 04/27/25, 13:58

    GeneralUtility.php:1917

    I'd abstain from adding a `suppress deprceation` option. I guess, this has been done for the corresponding test to not fail. I would suggest to remove the `$suppressDeprecation` parameter again and simply trigger the deprecation and instead add the PHPUnit attribute `#[IgnoreDeprecations]` attribute for the test method in https://review.typo3.org/c/Packages/TYPO3.CMS/+/88899/5/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php#2686 In older times we had dedicated UnitDeprecated/FunctionalDeprecated test suits in extension moving tests around, but using the attribute to keep test for deprecated functionality to ensure working state until removal. For the internal usage within GU (see below) corresponding tests / test permutations triggern calling this method should get the deprecation flag. Beside that, even suppressing the deprecation for the internal call will lead to a breaking and not deprecated behavior of the `sanitizeLocalUrl()` method. Maybe we should add there a check (for `..`) and only call it conditionally triggering the deprecation and otherwise omitting caling this deprecated method ? I mean to use ```php if (!str_contains($pathStr, '..')) {} else {} ``` in `sanitizeLocalUrl` to make developers aware if this deprecation is triggered hidden in a call chain for these cases (which they need to address anyway) and I would consider part of the deprecation (eventually mention it in the rest file?) Or move the code to a internal private method, keeping only the deprecation and than call the private method and in sanitizeLocalUrl the internal method directly. What do you think ?

    GeneralUtility.php:2573

    I would rather check if we really need resolveBackPath here, and only if needed calling it ending in triggering the deprecation.
  15. Benni Mack uploaded patch set 6 CR +1 V +1 04/28/25, 06:38

  16. core-ci voted on patch set 6 V -1 04/28/25, 06:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78263

  17. Benni Mack uploaded patch set 7 V -1 04/28/25, 06:47

  18. core-ci voted on patch set 7 V -1 04/28/25, 06:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78265

  19. Benni Mack uploaded patch set 8 V -1 04/28/25, 15:37

  20. core-ci voted on patch set 8 V +1 04/28/25, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78289

  21. Georg Ringer voted on patch set 8 CR +1 V +1 04/28/25, 19:23

  22. Stefan Bürk commented on patch set 8 CR +2 V +2 04/28/25, 19:30

    GeneralUtility.php:1917 Reply

    Done

    GeneralUtility.php:2573 Reply

    Done
  23. Stefan Bürk merged patch set 9 04/28/25, 19:30