fixed endless error loop in error handler

this happended when `stream` was set on the response but the stream resouce was invalid
either because it was already sent or became invalid for some other cases.

fixes #9046
This commit is contained in:
Carsten Brandt
2015-07-08 20:30:26 +02:00
parent 4f6f041e8b
commit 5d3532c649
2 changed files with 6 additions and 0 deletions

View File

@@ -69,7 +69,12 @@ class ErrorHandler extends \yii\base\ErrorHandler
{
if (Yii::$app->has('response')) {
$response = Yii::$app->getResponse();
// reset parameters of response to avoid interference with partially created response data
// in case the error occurred while sending the response.
$response->isSent = false;
$response->stream = null;
$response->data = null;
$response->content = null;
} else {
$response = new Response();
}