Review main Merged

78766[BUGFIX] Do not abort renameFile if filename sanitizable

Sybille Peters CR +2 V +2 Easy +41 −3 updated 07/06/23, 07:55

Commit message

It is possible to rename a file with ResourseStorage::renameFile(). This
is also used under the hood, if a file is renamed in the file list.

RenameFile also performs a sanitation of the filename, in case the
filename was not yet sanitized (e.g. convert chars like space, quote,
ö, ê, ß or §).

But if the target filename is the same as the current filename, the
sanitation was not performed. This is now fixed so that the behaviour
is more consistent and sanitizing files with renameFile() is possible.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Oliver Klee +1
    • Torben Hansen +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Oliver Klee +1
    • Torben Hansen +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2027

Show 2 earlier messages
  1. Sybille Peters uploaded patch set 1 04/20/23, 13:35

  2. Sybille Peters updated the commit message in patch set 2 04/20/23, 13:36

  1. Sybille Peters updated the commit message in patch set 3 04/20/23, 13:37

  2. core-ci voted on patch set 3 V -1 04/20/23, 14:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40971

  3. Sybille Peters rebased onto patch set 4 V -1 04/20/23, 15:54

  4. core-ci voted on patch set 4 V +1 04/20/23, 16:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40993

  5. Andreas Kienast voted on patch set 4 CR +1 04/21/23, 11:26

  6. Christian Kuhn commented on patch set 4 04/21/23, 13:26

    smells as if a test would be good for this. what do you think?
  7. Sybille Peters commented on patch set 4 04/21/23, 15:54

    Reply

    ok. I will look into it.
  8. Sybille Peters uploaded patch set 5 CR +1 V +1 04/23/23, 08:43

  9. Sybille Peters commented on patch set 5 04/23/23, 08:48

    Reply

    Added test. Performs as expected (test fails without change, does not fail with change). I tried to test in isolation only that the function renameFile() in ResourceStorage will actually call renameFile() in the driver if filename is to be sanitized only. I had to mock several classes (Driver and Indexer). I would have liked to write a simpler test, but did not see how to do that since renameFile is quite complex and uses Indexer etc. Alternative might be to actually perform the renameFile and not mock. Any tips are appreciated whether I should optimize the test.
  10. core-ci voted on patch set 5 V +1 04/23/23, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41098

  11. Benni Mack updated the commit message in patch set 6 V +1 05/03/23, 09:46

  12. Sybille Peters rebased onto patch set 7 05/12/23, 17:28

  13. core-ci voted on patch set 7 V +1 05/12/23, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41781

  14. Oliver Klee voted on patch set 7 V +1 05/12/23, 19:23

  15. Oliver Klee voted on patch set 7 CR +1 05/12/23, 19:23

  16. Sybille Peters rebased onto patch set 8 CR +1 V +1 05/31/23, 13:36

  17. core-ci voted on patch set 8 V +1 05/31/23, 13:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42116

  18. Torben Hansen uploaded patch set 9 V +1 07/05/23, 15:44

  19. core-ci voted on patch set 9 V -1 07/05/23, 16:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43549

  20. Sybille Peters rebased onto patch set 10 V -1 07/05/23, 16:31

  21. core-ci voted on patch set 10 V +1 07/05/23, 16:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43558

  22. Torben Hansen voted on patch set 10 V +1 CR +1 07/05/23, 17:44

  23. Oliver Klee voted on patch set 10 V +1 CR +1 07/05/23, 18:19

  24. Andreas Kienast voted on patch set 10 V +2 CR +2 07/06/23, 07:55

  25. Andreas Kienast merged patch set 11 07/06/23, 07:55