Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Check if path is a file in FileSystemLoader#1614

Merged
dbu merged 1 commit into
liip:2.xfrom
revoltek-daniel:patch-1
Dec 12, 2024
Merged

Check if path is a file in FileSystemLoader#1614
dbu merged 1 commit into
liip:2.xfrom
revoltek-daniel:patch-1

Conversation

@revoltek-daniel
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
@dbu
Copy link
Copy Markdown
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