Review main Merged

71804[BUGFIX] Properly return path relative to public dir in FilePathSanitizer

Florian Rival CR +2 V +2 Normal +118 −53 updated 10/26/21, 11:51

Commit message

The assumption for FilePathSanitizer::sanitize is to return file names
relative to the public directory of TYPO3.

Therefore, when making a given absolute file path relative
with PathUtility::getPublicResourceWebPath, we must ensure to set the
second argument to false to avoid adding the current site path
to the relative path, but just directly return the relative path.

This bug was not covered by the test, because on CLI this API
NEVER appends the current site path. Therefore the test is now adapted
to simulate a frontend web request.

Also streamline usage of Environment API in tests to clarify intent.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 2