Remove dependency on php extension fileinfo
This commit is contained in:
parent
f24aeb5a7a
commit
89ae8480da
@ -311,7 +311,12 @@ class SkinlibController extends Controller
|
||||
'public' => 'required'
|
||||
]);
|
||||
|
||||
$mime = $request->file('file')->getMimeType();
|
||||
if (extension_loaded('fileinfo')) {
|
||||
$mime = $request->file('file')->getMimeType();
|
||||
} else {
|
||||
$mime = $_FILES['file']['type'];
|
||||
}
|
||||
|
||||
if ($mime != "image/png" && $mime != "image/x-png") {
|
||||
return json(trans('skinlib.upload.type-error'), 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user