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

MIME being checked on missing file (maybe before file save) #8846

Closed
hypeJunction opened this Issue Aug 13, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@hypeJunction
Contributor

hypeJunction commented Aug 13, 2015

Test path with file_exists() before calling finfo_file() or mime_content_type()

@juho-jaakkola

This comment has been minimized.

Show comment
Hide comment
@juho-jaakkola

juho-jaakkola Aug 14, 2015

Member

Any idea what causes the file to be non-existent in the first place?

Member

juho-jaakkola commented Aug 14, 2015

Any idea what causes the file to be non-existent in the first place?

@hypeJunction

This comment has been minimized.

Show comment
Hide comment
@hypeJunction

hypeJunction Aug 14, 2015

Contributor

Will need to investigate. Some race condition I think. Something is
checking the mime before file is actually saved.
On Aug 14, 2015 3:24 PM, "Juho Jaakkola" notifications@github.com wrote:

Any idea what causes the file to be non-existent in the first place?


Reply to this email directly or view it on GitHub
#8846 (comment).

Contributor

hypeJunction commented Aug 14, 2015

Will need to investigate. Some race condition I think. Something is
checking the mime before file is actually saved.
On Aug 14, 2015 3:24 PM, "Juho Jaakkola" notifications@github.com wrote:

Any idea what causes the file to be non-existent in the first place?


Reply to this email directly or view it on GitHub
#8846 (comment).

@mrclay mrclay changed the title from ElggFile::detectMimeType() to MIME being checked on missing file (maybe before file save) Aug 17, 2015

@hypeJunction

This comment has been minimized.

Show comment
Hide comment
@hypeJunction

hypeJunction Aug 24, 2015

Contributor

Found the bugger. Calling getMimeType() on an instance of ElggFile (not statically), the path is set to filename, whereas it should be normalized to filename on filestore.

Contributor

hypeJunction commented Aug 24, 2015

Found the bugger. Calling getMimeType() on an instance of ElggFile (not statically), the path is set to filename, whereas it should be normalized to filename on filestore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment