Skip to content

Commit

Permalink
fix console bug, fix redirect response
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 18, 2016
1 parent 7c6173f commit 85249be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/Console/ClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
25 changes: 20 additions & 5 deletions src/Illuminate/Http/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 85249be

Please sign in to comment.