From 201fe21e6da5fbfdf2460632afc0fd5c46e7fec8 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Fri, 20 Jul 2018 17:32:27 +0800 Subject: [PATCH] Update PHP requirement --- README.md | 6 ++++-- README_EN.md | 8 +++++--- app/Http/Controllers/SkinlibController.php | 7 +------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 44bc10f4..c9c2d17c 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,10 @@ Blessing Skin 对您的服务器有一定的要求。_在大多数情况下, - Mbstring - Tokenizer - GD - -如果你使用的是 PHP 7.2,请先阅读 [Wiki - 在 PHP 7.2 上运行](https://github.com/printempw/blessing-skin-server/wiki/%E5%9C%A8-PHP-7.2-%E4%B8%8A%E8%BF%90%E8%A1%8C)。 + - XML + - Ctype + - JSON + - fileinfo 快速使用 ----------- diff --git a/README_EN.md b/README_EN.md index 0ff04132..c8b86208 100644 --- a/README_EN.md +++ b/README_EN.md @@ -46,9 +46,11 @@ Blessing Skin has only a few system requirements. _In most cases, these PHP exte - PDO PHP Extension - Mbstring PHP Extension - Tokenizer PHP Extension -- GD PHP Extension (for generating CAPTCHA) - -If you are using PHP 7.2, you should also apply this [patch](https://github.com/printempw/blessing-skin-server/wiki/%E5%9C%A8-PHP-7.2-%E4%B8%8A%E8%BF%90%E8%A1%8C) after your installation. Just extract the `vendor` folder from the patch, cover the stock `vendor` with that and you are done. +- GD PHP Extension +- XML PHP Extension +- Ctype PHP Extension +- JSON PHP Extension +- fileinfo PHP Extension Quick Install ----------- diff --git a/app/Http/Controllers/SkinlibController.php b/app/Http/Controllers/SkinlibController.php index 10f186e1..724bc3e9 100644 --- a/app/Http/Controllers/SkinlibController.php +++ b/app/Http/Controllers/SkinlibController.php @@ -321,12 +321,7 @@ class SkinlibController extends Controller 'public' => 'required' ]); - if (extension_loaded('fileinfo')) { - $mime = $request->file('file')->getMimeType(); - } else { - $mime = $_FILES['file']['type']; - } - + $mime = $request->file('file')->getMimeType(); if ($mime != "image/png" && $mime != "image/x-png") { return json(trans('skinlib.upload.type-error'), 1); }