From 1f86a502ef797e2fb94bf9544fe896de3107533d Mon Sep 17 00:00:00 2001 From: Jonathan Martins Date: Sat, 15 Nov 2014 12:09:32 -0200 Subject: [PATCH] File upload is broken when submitting a form... ...without selecting a file in Laravel 5! My tests revealed that with this tweek the problem described at this issue are resolved: laravel/framework#6189 I don't make unit tests, but this will no more break my code flow. I'm not sure if this is the real deal! If someone could look deeper into the problem, I appreciated! | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | --- src/Symfony/Component/HttpFoundation/FileBag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/FileBag.php b/src/Symfony/Component/HttpFoundation/FileBag.php index 467c31576b586..39f20ca2b305f 100644 --- a/src/Symfony/Component/HttpFoundation/FileBag.php +++ b/src/Symfony/Component/HttpFoundation/FileBag.php @@ -94,7 +94,7 @@ protected function convertFileInformation($file) if ($keys == self::$fileKeys) { if (UPLOAD_ERR_NO_FILE == $file['error']) { - $file = null; + $file = array(); } else { $file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); }