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

Add fallback for missing finfo_open #2178

Merged
merged 1 commit into from
Sep 2, 2019

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Sep 2, 2019

Description
I've just encountered my second sizable hosting company that doesn't have the fileinfo extension available. This causes File->getMimeType() to fail:

CRITICAL - 2019-09-01 21:32:28 --> Call to undefined function CodeIgniter\Files\finfo_open()

Given that this is a "standard" setup it probably isn't safe to rely on this function. This PR checks for the function, and failing to find it reverts to the client's reported MIME type.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell merged commit 4469721 into codeigniter4:develop Sep 2, 2019
@MGatner MGatner deleted the finfo-mimetype branch September 2, 2019 11:00
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.

2 participants