mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 02:49:03 +08:00
编辑器粘贴优化
This commit is contained in:
parent
97826ae88b
commit
48107a7453
@ -350,7 +350,8 @@ class Uploader
|
||||
$imgUrl = str_replace("&", "&", $imgUrl);
|
||||
|
||||
//检查是否不允许的文件格式
|
||||
if (!$this->checkType()) {
|
||||
$ext = explode('?', strtolower(strrchr($imgUrl, '.')));
|
||||
if (!$this->checkType($ext[0])) {
|
||||
$this->stateInfo = $this->getStateInfo("ERROR_TYPE_NOT_ALLOWED");
|
||||
return;
|
||||
}
|
||||
@ -502,9 +503,10 @@ class Uploader
|
||||
* 文件类型检测
|
||||
* @return bool
|
||||
*/
|
||||
private function checkType()
|
||||
private function checkType($ext = null)
|
||||
{
|
||||
return in_array($this->getFileExt(), $this->config["allowFiles"]);
|
||||
$ext = empty($ext) ? $this->getFileExt() : $ext;
|
||||
return in_array($ext, $this->config["allowFiles"]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user