{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14143","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14143/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14143/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14143/events","html_url":"https://github.com/laravel/framework/issues/14143","id":162374357,"number":14143,"title":"Validating Multiple Files if failed will reset all sessions on php7","user":{"login":"3alampro","id":6272271,"avatar_url":"https://avatars.githubusercontent.com/u/6272271?v=3","gravatar_id":"","url":"https://api.github.com/users/3alampro","html_url":"https://github.com/3alampro","followers_url":"https://api.github.com/users/3alampro/followers","following_url":"https://api.github.com/users/3alampro/following{/other_user}","gists_url":"https://api.github.com/users/3alampro/gists{/gist_id}","starred_url":"https://api.github.com/users/3alampro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3alampro/subscriptions","organizations_url":"https://api.github.com/users/3alampro/orgs","repos_url":"https://api.github.com/users/3alampro/repos","events_url":"https://api.github.com/users/3alampro/events{/privacy}","received_events_url":"https://api.github.com/users/3alampro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-27T05:00:48Z","updated_at":"2016-06-27T05:00:48Z","closed_at":null,"body":"Hello,\r\n\r\ni got this issue on laravel 5.2 and php7 i'm not sure about other versions since we got array validation on 5.2.\r\n\r\nif you created form to upload multi-files and created request rules to validate the input if validations fails you will redirected back to the form with all sessions deleted.\r\n\r\nby looking into laravel.log i got\r\n\r\n```\r\n[2016-06-27 04:23:13] local.ERROR: Exception: Serialization of 'Illuminate\\Http\\UploadedFile' is not allowed in /Applications/MAMP/htdocs/upload-multiple-files/bootstrap/cache/compiled.php:12115\r\nStack trace:\r\n#0 /Applications/MAMP/htdocs/upload-multiple-files/bootstrap/cache/compiled.php(12115): serialize(Array)\r\n#1 /Applications/MAMP/htdocs/upload-multiple-files/bootstrap/cache/compiled.php(11936): Illuminate\\Session\\Store->save()\r\n#2 /Applications/MAMP/htdocs/upload-multiple-files/bootstrap/cache/compiled.php(2375): Illuminate\\Session\\Middleware\\StartSession->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\RedirectResponse))\r\n#3 /Applications/MAMP/htdocs/upload-multiple-files/public/index.php(58): Illuminate\\Foundation\\Http\\Kernel->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\RedirectResponse))\r\n#4 {main} \r\n```\r\ni tried tracking the issue to `withInput` method on `Illuminate\\Http\\RedirectResponse` and it seem for some reason this code\r\n```\r\nreturn ! $value instanceof SymfonyUploadedFile;\r\n```\r\nis not working on php7 but work on php5.6 so i change it to this\r\n```\r\nif(!$value instanceof SymfonyUploadedFile)\r\n{\r\n    return $value;\r\n}\r\n```\r\nthis did fix it for me and all sessions will not be deleted because of trying to serialize resource 'files' but we also lost all errors related to this specific input field i hope this can improved or fixed in the next release\r\n\r\ni created repo to demonstrate the issue \r\nhttps://github.com/3alampro/upload-multiple-files\r\nall you have to do is install it and run it on php7 and try to fail the validations by uploading non image files you can see that you will redirected back with reset sessions (old input,errors and auth if you used them) and you no longer have access to them"}}
{"actor":{"display_login":"3alampro"}}