diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 7170925867..50ce96c3a8 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -22,6 +22,7 @@ Yii Framework 2 Change Log - Bug #8661: Fixed `yii.activeForm.js` scrolling to top (nkovacs) - Bug #8772: ActiveQuery failed removing duplicate records after join when the resultset did not contain the pk values e.g. after grouping (cebe) - Bug #8900: Fixed determine active menu item with url-alias in route `\yii\widgets\Menu::isItemActive()` (demi) +- Bug #9046: Fixed problem with endless error loop when an error occurred after sending a stream or file download response to the user (cebe) - Bug: Fixed string comparison in `BaseActiveRecord::unlink()` which may result in wrong comparison result for hash valued primary keys starting with `0e` (cebe) - Bug: Pass correct action name to `yii\console\Controller::options()` when default action was requested (cebe) - Bug: Automatic garbage collection in `yii\caching\FileCache` was not triggered (kidol) diff --git a/framework/web/ErrorHandler.php b/framework/web/ErrorHandler.php index bd651247b5..99a54a2024 100644 --- a/framework/web/ErrorHandler.php +++ b/framework/web/ErrorHandler.php @@ -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(); }