Skip to content

Commit

Permalink
V1.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy0520 committed Mar 22, 2022
1 parent 138a5a3 commit b81e65c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public function video($video)
}
self::$size = $file->size;
$ext = $file->getExtension();
$this->validateExt($ext);
$path = $this->get_url('video'); //获取当日目录
self::$path = '/' . $path . '/' . md5(get_sn()) . ".{$ext}"; //设置视频路径
//本地上传
Expand Down Expand Up @@ -310,4 +311,12 @@ private function getUploadFile($localFilePath)
'size' => $size,
]);
}

private function validateExt($ext)
{
if (!in_array($ext, ['mp4', 'ogg'])) {
Error('不支持的视频类型');
}
return true;
}
}
2 changes: 1 addition & 1 deletion web/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.4.8"}
{"version":"1.4.9"}

0 comments on commit b81e65c

Please sign in to comment.