mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Fixes #8613: FragmentCache storing empty content causes problem with PageCache
This commit is contained in:
@ -29,6 +29,7 @@ Yii Framework 2 Change Log
|
||||
- Enh #8486: Added support to automatically set the `maxlength` attribute for `Html::activeTextArea()` and `Html::activePassword()` (klimov-paul)
|
||||
- Enh #8566: Added support for 'only' and 'except' options for `yii\web\AssetManager::publish()` (klimov-paul)
|
||||
- Enh #8574: Added `yii\console\controllers\MessageController` support .pot file creation (pgaultier)
|
||||
- Enh #8613: `yii\widgets\FragmentCache` will not store empty content anymore which fixes some problems related to `yii\filters\PageCache` (kidol)
|
||||
- Chg #6354: `ErrorHandler::logException()` will now log the whole exception object instead of only its string representation (cebe)
|
||||
- Chg #8556: Extracted `yii\web\User::getAuthManager()` method (samdark)
|
||||
|
||||
|
@ -104,6 +104,9 @@ class FragmentCache extends Widget
|
||||
echo $content;
|
||||
} elseif ($this->cache instanceof Cache) {
|
||||
$content = ob_get_clean();
|
||||
if ($content === false || $content === '') {
|
||||
return;
|
||||
}
|
||||
array_pop($this->getView()->cacheStack);
|
||||
if (is_array($this->dependency)) {
|
||||
$this->dependency = Yii::createObject($this->dependency);
|
||||
|
Reference in New Issue
Block a user