Skip to content

Commit

Permalink
fix: go through the after filters.
Browse files Browse the repository at this point in the history
Signed-off-by: ytetsuro <[email protected]>
  • Loading branch information
ytetsuro committed Oct 9, 2018
1 parent 77cd602 commit 0e30902
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CodeIgniter

/**
* Current response.
* @var HTTP\Response
* @var HTTP\ResponseInterface
*/
protected $response;

Expand Down Expand Up @@ -321,23 +321,13 @@ protected function handleRequest(RouteCollectionInterface $routes = null, $cache

$this->callExit(EXIT_SUCCESS);
}
elseif ($returned instanceof DownloadResponse)
{
$returned->pretend($this->useSafeOutput)->send();

if ($returnResponse)
{
return $returned;
}

$this->callExit(EXIT_SUCCESS);
}

// If $returned is a string, then the controller output something,
// probably a view, instead of echoing it directly. Send it along
// so it can be used with the output.
$this->gatherOutput($cacheConfig, $returned);

$filters->setResponse($this->response);
// Run "after" filters
$response = $filters->run($uri, 'after');

Expand Down Expand Up @@ -902,6 +892,10 @@ protected function gatherOutput($cacheConfig = null, $returned = null)
ob_end_clean();
}

if ($returned instanceof DownloadResponse) {
$this->response = $returned;
return;
}
// If the controller returned a response object,
// we need to grab the body from it so it can
// be added to anything else that might have been
Expand Down

0 comments on commit 0e30902

Please sign in to comment.