Check for UPLOAD_ERR_NO_FILE in UploadedFile

fixes #4276, close #4358
This commit is contained in:
OmgDef
2014-07-18 21:36:29 +04:00
committed by Carsten Brandt
parent 371af5c486
commit 697a85dd26
3 changed files with 5 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ Yii Framework 2 Change Log
- Bug #4127: `CaptchaValidator` clientside error message wasn't formed properly (samdark)
- Bug #4162: Fixed bug where schema name was not used in SHOW CREATE TABLE query in `yii\db\mysql\Schema` (stevekr)
- Bug #4241: `yii\widgets\Pjax` was incorrectly setting container id (mitalcoi)
- Bug #4276: Added check for UPLOAD_ERR_NO_FILE in `yii\web\UploadedFile` and return null if no file was uploaded (OmgDef)
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
- Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
- Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)

View File

@@ -223,7 +223,7 @@ class UploadedFile extends Object
foreach ($names as $i => $name) {
self::loadFilesRecursive($key . '[' . $i . ']', $name, $tempNames[$i], $types[$i], $sizes[$i], $errors[$i]);
}
} else {
} elseif ($errors !== UPLOAD_ERR_NO_FILE) {
self::$_files[$key] = new static([
'name' => $names,
'tempName' => $tempNames,