Fix PHP 8 incompatibility with conversion false to array (#5774)

This commit is contained in:
Yuriy Bakhtin 2022-06-27 16:27:40 +03:00 committed by GitHub
parent 9736bdeea5
commit 2ff7f6dce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Fix #5735: OEmbed migration might fail with more complex Endpoint URLs
- Fix #5760: Fix context menu position on the right window side
- Fix #5759: Fix tests on enable space module
- Fix #5773: Fix PHP 8 incompatibility with conversion false to array
1.11.2 (May 30, 2022)

View File

@ -222,6 +222,9 @@ class Comment extends ContentAddonActiveRecord implements ContentOwner
$cacheID = sprintf(static::CACHE_KEY_LIMITED, $model, $id);
$comments = $useCaching ? Yii::$app->cache->get($cacheID) : [];
if (!is_array($comments)) {
$comments = [];
}
if (!isset($comments[$limit]) || !is_array($comments[$limit])) {
$objectCondition = ['object_model' => $model, 'object_id' => $id];