优化代码
parent
0a3edd9e64
commit
4630ed8397
|
@ -336,7 +336,7 @@ class ArticleController extends CController
|
||||||
public function uploadArticleImage()
|
public function uploadArticleImage()
|
||||||
{
|
{
|
||||||
$file = $this->request->file('image');
|
$file = $this->request->file('image');
|
||||||
if (!$file->isValid()) {
|
if (!$file || !$file->isValid()) {
|
||||||
return $this->response->fail();
|
return $this->response->fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +463,7 @@ class ArticleController extends CController
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$file = $this->request->file('annex');
|
$file = $this->request->file('annex');
|
||||||
if (!$file->isValid()) {
|
if (!$file || !$file->isValid()) {
|
||||||
return $this->response->fail('上传文件验证失败!');
|
return $this->response->fail('上传文件验证失败!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -487,7 +487,7 @@ class TalkController extends CController
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$file = $this->request->file('img');
|
$file = $this->request->file('img');
|
||||||
if (!$file->isValid()) {
|
if (!$file || !$file->isValid()) {
|
||||||
return $this->response->fail();
|
return $this->response->fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ class UploadController extends CController
|
||||||
'split_num' => 'required'
|
'split_num' => 'required'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$file->isValid()) {
|
if (!$file || !$file->isValid()) {
|
||||||
return $this->response->fail();
|
return $this->response->fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue