diff --git a/src/Illuminate/Cache/Console/ClearCommand.php b/src/Illuminate/Cache/Console/ClearCommand.php index f9d58247c59b..899269a9cd30 100755 --- a/src/Illuminate/Cache/Console/ClearCommand.php +++ b/src/Illuminate/Cache/Console/ClearCommand.php @@ -50,7 +50,7 @@ public function __construct(CacheManager $cache) */ public function handle() { - $tags = (array) explode(',', $this->option('tags')); + $tags = array_filter(explode(',', $this->option('tags'))); $cache = $this->cache->store($store = $this->argument('store')); diff --git a/src/Illuminate/Http/RedirectResponse.php b/src/Illuminate/Http/RedirectResponse.php index 5c78ff4f92b9..419314a9ec92 100755 --- a/src/Illuminate/Http/RedirectResponse.php +++ b/src/Illuminate/Http/RedirectResponse.php @@ -72,15 +72,30 @@ public function withInput(array $input = null) { $input = $input ?: $this->request->input(); - $this->session->flashInput($data = array_filter($input, $callback = function (&$value) use (&$callback) { + $this->session->flashInput($this->removeFilesFromInput($input)); + + return $this; + } + + /** + * Remove all uploaded files form the given input array. + * + * @param array $input + * @return array + */ + protected function removeFilesFromInput(array $input) + { + foreach ($input as $key => $value) { if (is_array($value)) { - $value = array_filter($value, $callback); + $input[$key] = $this->removeFilesFromInput($value); } - return ! $value instanceof SymfonyUploadedFile; - })); + if ($value instanceof SymfonyUploadedFile) { + unset($input[$key]); + } + } - return $this; + return $input; } /**