|
|
@@ -66,7 +66,6 @@ class Ajax extends Backend
|
|
|
$suffix = strtolower(pathinfo($fileInfo['name'], PATHINFO_EXTENSION));
|
|
|
$suffix = $suffix && preg_match("/^[a-zA-Z0-9]+$/", $suffix) ? $suffix : 'file';
|
|
|
|
|
|
- var_dump($upload);
|
|
|
$mimetypeArr = explode(',', strtolower($upload['mimetype']));
|
|
|
$typeArr = explode('/', $fileInfo['type']);
|
|
|
|
|
|
@@ -85,7 +84,7 @@ class Ajax extends Backend
|
|
|
}
|
|
|
//验证是否为图片文件
|
|
|
$imagewidth = $imageheight = 0;
|
|
|
- if (in_array($fileInfo['type'], ['image/gif', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/png', 'image/webp']) || in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'webp','video','mp4'])) {
|
|
|
+ if (in_array($fileInfo['type'], ['image/gif', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/png', 'image/webp']) || in_array($suffix, ['gif', 'jpg', 'jpeg', 'bmp', 'png', 'webp'])) {
|
|
|
$imgInfo = getimagesize($fileInfo['tmp_name']);
|
|
|
if (!$imgInfo || !isset($imgInfo[0]) || !isset($imgInfo[1])) {
|
|
|
$this->error(__('Uploaded file is not a valid image'));
|