Skip to content
Snippets Groups Projects
Commit 4a87bd2e authored by Florian Rival's avatar Florian Rival Committed by Helmut Hummel
Browse files

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

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.

Releases: master
Resolves: #95644
Change-Id: I20e7e6f434e4b4ca47aca35c79ec20e659fd7114
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71804


Tested-by: default avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarphysikbuddha <r.kaerner@oranto.de>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
Reviewed-by: default avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: default avatarphysikbuddha <r.kaerner@oranto.de>
Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
parent 3b7a862f
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment