Fixes #11132: Fixed yii\widgets\FragmentCache not handling empty content correctly in all cases

This commit is contained in:
kidol
2016-04-12 01:03:27 +02:00
committed by Alexander Makarov
parent 7976aaeb59
commit ff55874457
2 changed files with 3 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ Yii Framework 2 Change Log
- Bug #11026: Fixed `StringHelper::truncateWords()` to count words properly for non-English text (samdark, tol17)
- Bug #11040: Check parameter 'recursive' and disable recursive copying with option 'recursive' => false in method BaseFileHelper::copyDirectory (Ni-san)
- Bug #11125: Fixed `JSON_ERROR_SYNTAX` for `json_decode(null)` in PHP 7 (fps01)
- Bug #11132: Fixed `yii\widgets\FragmentCache` not handling empty content correctly in all cases (kidol)
- Bug #11188: Fixed wrong index usage in `CaptchaAction` when calling `imagefilledrectangle` (alsopub)
- Bug #11220: NumberValidator now handles objects properly (samdark)
- Bug #11221: Boolean validator generates incorrect error message (azaikin, githubjeka)

View File

@@ -104,11 +104,12 @@ class FragmentCache extends Widget
if (($content = $this->getCachedContent()) !== false) {
echo $content;
} elseif ($this->cache instanceof Cache) {
array_pop($this->getView()->cacheStack);
$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);
}