Remove dependency on php extension fileinfo

This commit is contained in:
printempw 2018-06-19 21:04:15 +08:00
parent f24aeb5a7a
commit 89ae8480da

View File

@ -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);
}