Skip to content

Commit 4469721

Browse files
authored
Merge pull request #2178 from MGatner/finfo-mimetype
Add fallback for missing finfo_open
2 parents 2b3981b + 24ce0cd commit 4469721

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

system/Files/File.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ public function guessExtension(): ?string
134134
*/
135135
public function getMimeType(): string
136136
{
137+
if (! function_exists('finfo_open'))
138+
{
139+
return $this->originalMimeType ?? 'application/octet-stream';
140+
}
141+
137142
$finfo = finfo_open(FILEINFO_MIME_TYPE);
138143
$mimeType = finfo_file($finfo, $this->getRealPath());
139144
finfo_close($finfo);

0 commit comments

Comments
 (0)