Review main Merged

89572[BUGFIX] Fix negated disallowed check in drag-uploader

Benjamin Franzke CR +2 V +2 Easy +8 −8 updated 05/29/25, 09:25

Commit message

`checkDisallowedExtensions()` is expected to return
false if the extension is disallowed, the negation was
incorrectly migrated with #102415.

This mistake is hard to guess, given the ambiguous name,
therefore the methods for allow-list and disallow-list
are now renamed to reflect their intended result and
the conditions are adapted to check the particular
cases.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Garvin Hicking +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1315

  1. Benjamin Franzke uploaded patch set 1 05/27/25, 15:13

  2. core-ci voted on patch set 1 V +1 05/27/25, 15:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79582

  3. Nikita Hovratov voted on patch set 1 CR +1 05/27/25, 16:02

  4. Andreas Kienast voted on patch set 1 CR +1 V +1 05/28/25, 07:05

  5. Garvin Hicking commented on patch set 1 CR +1 V +1 05/28/25, 07:15

    personally I would probably rename this: checkAllowedExtensions -> isAllowedFileExtension() (return types unchanged) checkDisallowedExtensions -> isDisallowedFileExtension() (return types unchanged, but query it with `this.isDisallowedFileExtension()` instead `!checkDisallowedExtensions()`. Having said this, current approach works to bit is a bit mind-boggley :D
  6. Benjamin Franzke commented on patch set 1 CR -1 05/28/25, 08:01

    Reply

    well, we thought the same. So let's go ahead and do that! :)
  7. Benjamin Franzke uploaded patch set 2 CR +1 V +1 05/28/25, 08:12

  8. Benjamin Franzke commented on patch set 2 05/28/25, 08:12

    Reply

    Done
  9. Andreas Kienast voted on patch set 2 CR +1 05/28/25, 08:14

  10. core-ci voted on patch set 2 V +1 05/28/25, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79614

  11. Garvin Hicking commented on patch set 2 CR +1 V +1 05/28/25, 08:47

    Reply

    (nitpick: we don't use "prohibited" really anywhere, and coupling "prohibited" with "disallowed" is a bit of unneeded cognitive load, so I'd really opt for either "isGranted" (a term used more often in our codebase) or "isAllowedByFileExtensionList" and "isDisallowedByFileExtensionList" - that reduces it to one usage of dis/allowed) (Not going to die on this hill, though :D)
  12. Benjamin Franzke commented on patch set 2 05/28/25, 12:21

    Reply

    I wanted a term that is *not* "disallowed" in order to distinguish from the allow and disallow lists. I think the term "grants" fits better into permissions and I'd like a term that describes the non-allowed case, in order to avoid the negation by the caller in the condition where this method is used..
  13. Garvin Hicking commented on patch set 2 05/28/25, 15:29

    Reply

    Filed under "naming things", let's move on :-D
  14. Oli Bartsch voted on patch set 2 CR +2 V +2 05/29/25, 09:25

  15. Oli Bartsch merged patch set 3 05/29/25, 09:25