Fix lazy Twig mode dropping the path for absolute image URLs#1655
Open
Atesca wants to merge 1 commit into
Open
Fix lazy Twig mode dropping the path for absolute image URLs#1655Atesca wants to merge 1 commit into
Atesca wants to merge 1 commit into
Conversation
In lazy mode, absolute image URLs (S3/Flysystem/VichUploader) were passed to the CacheManager unchanged, breaking cache resolution. Legacy mode always ran parse_url($path, PHP_URL_PATH) first; LazyFilterRuntime dropped it (commit 13a32e4). Restore that normalization in cleanPath() (covers filter() and filterCache()), but only when the path has a host, so local filenames containing "?" or "#" are left untouched. Fixes liip#1447
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1447.
In
lazyTwig mode, absolute image URLs (S3/Flysystem/VichUploader) break:the full URL is passed to the
CacheManagerunchanged. Legacy mode alwaysran
parse_url($path, PHP_URL_PATH)first;LazyFilterRuntimedropped it(commit 13a32e4).
This restores that normalization in
cleanPath()— covering bothfilter()and
filterCache()— but only when the path has a host, so local filenamescontaining
?or#are left untouched.A reproducing test case is included: the new
absolute urlcases failwithout the fix and pass with it, while existing cases stay green.