Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if path is a file in FileSystemLoader #1614

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Conversation

revoltek-daniel
Copy link
Contributor

Q A
Branch? 2.x
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

If the resolve URL is called without a file like "media/cache/resolve/image_xs/media/image/40/93/" the FileinfoMimeTypeGuesser will fail with a InvalidArgumentException, because the mime type checker will check if the path is a file. https://github.com/symfony/symfony/blob/7.2/src/Symfony/Component/Mime/FileinfoMimeTypeGuesser.php#L47

So we should check before if it is a file or catch the exception.

@coveralls
Copy link

Coverage Status

coverage: 81.665% (-0.02%) from 81.688%
when pulling 59a78cd on revoltek-daniel:patch-1
into 98e0318 on liip:2.x.

Copy link
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense, thank you!

@dbu dbu merged commit 6d8dee9 into liip:2.x Dec 12, 2024
29 of 30 checks passed
@dbu
Copy link
Member

dbu commented Dec 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants