Fix #19670: Fix Error null check PHP 8.1 yii\rbac\DbManager

This commit is contained in:
Samuele Renati
2022-11-14 09:39:41 +01:00
committed by GitHub
parent e3dab27c33
commit c33ef022fe
2 changed files with 10 additions and 3 deletions

View File

@ -17,6 +17,7 @@ Yii Framework 2 Change Log
- Bug #19316: Fix MysqlMutex with same connection but difference database (kamarton)
- Bug #19507: Fix eager loading of nested one-to-many relations (spo0okie)
- Bug #19546: Reverted #19309 (bizley)
- Bug #19670: Fix Error null check PHP 8.1 `yii\rbac\DbManager` (samuelexyz)
- Bug #19520: Fix for TIMESTAMP & ROWVERSION columns in MSSQL insert query (darkdef)

View File

@ -654,7 +654,9 @@ class DbManager extends BaseManager
if (is_resource($data)) {
$data = stream_get_contents($data);
}
if ($data === null) {
return null;
}
return unserialize($data);
}
@ -675,7 +677,9 @@ class DbManager extends BaseManager
if (is_resource($data)) {
$data = stream_get_contents($data);
}
$rules[$row['name']] = unserialize($data);
if ($data) {
$rules[$row['name']] = unserialize($data);
}
}
return $rules;
@ -1013,7 +1017,9 @@ class DbManager extends BaseManager
if (is_resource($data)) {
$data = stream_get_contents($data);
}
$this->rules[$row['name']] = unserialize($data);
if ($data) {
$this->rules[$row['name']] = unserialize($data);
}
}
$query = (new Query())->from($this->itemChildTable);