Review main Merged

74599[BUGFIX] Always call GU::intExplode with a string in EXT:backend

Oliver Klee CR +2 V +2 Easy +21 −20 updated 06/08/22, 07:27

Commit message

This helps avoid breakage when GeneralUtility will switch to
strict mode.

This change also prevents a whole bunch of possible invalid
array access warnings.

Review

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

Issues 1

Files 13

Review log 3442

Show 1417 earlier messages
  1. Oliver Klee uploaded patch set 1 05/10/22, 10:55

  2. Oliver Klee commented on patch set 1 CR -1 05/10/22, 10:56

    on it
  3. Oliver Klee uploaded patch set 2 05/10/22, 10:58

  4. core-ci voted on patch set 2 V +1 05/10/22, 11:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27091

  5. core-ci voted on patch set 1 V +1 05/10/22, 11:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27090

  6. Georg Ringer commented on patch set 2 05/10/22, 11:21

    EditDocumentController.php:1331

    there is already an isset() before, so a type cast should be enough

    NewRecordController.php:305

    there is already an isset(), type cast should be enough

    SuggestWizardController.php:147

    already an isset() there

    DatabaseLanguageRows.php:78

    there is already an ifempty check, still needed or needs to be adapted?

    TcaCategory.php:140

    already an isset()

    TcaSelectTreeItems.php:75

    isset()?

    SuggestWizardDefaultReceiver.php:111

    isset()

    BackendUtility.php:1178

    field will always be there
  7. Oliver Klee commented on patch set 2 05/10/22, 11:24

    on it
  8. Oliver Klee voted on patch set 2 CR -1 05/10/22, 11:24

  9. Oliver Klee commented on patch set 2 05/10/22, 11:32

    Thanks for the review, Georg!

    EditDocumentController.php:1331 Reply

    Done

    NewRecordController.php:305 Reply

    Done

    SuggestWizardController.php:147 Reply

    Done

    DatabaseLanguageRows.php:78 Reply

    Done

    TcaCategory.php:140 Reply

    Done

    TcaSelectTreeItems.php:75 Reply

    Done

    SuggestWizardDefaultReceiver.php:111 Reply

    Done

    BackendUtility.php:1178 Reply

    Done
  10. Oliver Klee uploaded patch set 3 05/10/22, 11:32

  11. core-ci voted on patch set 3 V +1 05/10/22, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27094

  12. Stefan Bürk voted on patch set 3 V +1 CR +1 05/11/22, 23:50

  13. crell commented on patch set 3 06/03/22, 14:46

    "This helps avoid breakage when GeneralUtility will switch to strict mode." I don't follow this statement. Assuming intExplode() eventually gets typed parameters, its strict/weak mode flag will have no impact on any of these calls. They're all related to the string/weak flag in their own files. If the calling file is already in strict mode, then yes this or similar will be needed when intExplode() gets typed. But then the comment should be "when GeneralUtility gets typed parameters", because its strict mode flag is irrelevant to this patch.
  14. Oliver Klee commented on patch set 3 06/03/22, 15:01

    Reply

    The current breakage after setting the file to use strict mode (without adding natives types anywhere) occurs when GU::intExplode calls the explode function (which needs to be called with two strings, and in strict mode PHP does not silently tries to convert non-strings to strings): public static function intExplode($delimiter, $string, $removeEmptyValues = false, $limit = 0) { $result = explode($delimiter, $string) ?: [];
  15. crell commented on patch set 3 CR +1 06/03/22, 15:24

    Reply

    Ah! OK, that makes sense. It's not obvious from just reading the commit message. (It wouldn't have occurred to me to switch GU to strict without also first adding types to it, I suppose.)
  16. Oliver Klee commented on patch set 3 06/03/22, 15:45

    How to verify: Check that https://review.typo3.org/c/Packages/TYPO3.CMS/+/74572 (that also has these changes and marks GU as strict) has a green build. (I will create more changes for the corresponding fixes in the other extensions before marking GU as strict.)
  17. Nikita Hovratov uploaded patch set 4 06/04/22, 22:18

  1. Nikita Hovratov commented on patch set 4 V +1 CR +1 06/04/22, 22:19

    Removed the coalesce operator where it can't be null, due to !empty check.
  2. core-ci voted on patch set 4 V +1 06/04/22, 22:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27701

  3. Oliver Klee commented on patch set 4 06/05/22, 18:28

    Thanks,

    Reply

    Thanks, Nikita!
  4. crell voted on patch set 4 CR +1 06/06/22, 15:53

  5. Stefan Bürk commented on patch set 5 06/06/22, 19:36

    Published edit on patch set 4.
  6. Stefan Bürk rebased onto patch set 6 06/06/22, 19:36

  7. core-ci voted on patch set 5 V +1 06/06/22, 19:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27745

  8. core-ci voted on patch set 6 V +1 06/06/22, 19:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27746

  9. Stefan Bürk voted on patch set 6 V +1 CR +1 06/06/22, 20:02

  10. crell voted on patch set 6 CR +1 06/06/22, 20:20

  11. Christian Kuhn commented on patch set 6 06/06/22, 21:30

    could we leave out v11 since this is 'future GU should be strict' anyways?
  12. Stefan Bürk commented on patch set 6 V 0 CR 0 06/06/22, 21:32

    Reply

    Ack. Just checked backport. Would need adoptions anyway, so would like to remove v11 also from the list.
  13. Oliver Klee commented on patch set 6 06/06/22, 23:23

    Reply

    Done.
  14. Oliver Klee uploaded patch set 7 06/07/22, 16:12

  15. core-ci voted on patch set 7 V +1 06/07/22, 16:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27772

  16. Stefan Bürk voted on patch set 7 V +1 CR +1 06/07/22, 16:22

  17. Georg Ringer voted on patch set 7 V +1 CR +1 06/07/22, 18:58

  18. crell voted on patch set 7 CR +1 06/07/22, 19:37

  19. Nikita Hovratov uploaded patch set 8 06/07/22, 20:48

  20. Nikita Hovratov commented on patch set 8 V +1 CR +1 06/07/22, 20:55

    Added my change from patchset 4 back
  21. core-ci voted on patch set 8 V +1 06/07/22, 20:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27778

  22. Oliver Klee commented on patch set 8 06/07/22, 21:16

    Reply

    Oh, I'm sorry, I seem to have forgotten your change when I pushed from my local copy. Thanks for taking care of that!
  23. Stefan Bürk voted on patch set 8 V +1 CR +1 06/08/22, 07:24

  24. Nikita Hovratov voted on patch set 8 V +2 CR +2 06/08/22, 07:26

  25. Nikita Hovratov merged patch set 9 06/08/22, 07:27