mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-20 22:27:57 +01:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user