mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fixes #13961: RBAC Rules: PostgreSQL: PHP Warning "unserialize() expects parameter 1 to be string, resource given" was fixed
This commit is contained in:
committed by
Alexander Makarov
parent
510cd3541d
commit
d2fb17f444
@ -987,7 +987,11 @@ class DbManager extends BaseManager
|
||||
$query = (new Query)->from($this->ruleTable);
|
||||
$this->rules = [];
|
||||
foreach ($query->all($this->db) as $row) {
|
||||
$this->rules[$row['name']] = unserialize($row['data']);
|
||||
$data = $row['data'];
|
||||
if (is_resource($data)) {
|
||||
$data = stream_get_contents($data);
|
||||
}
|
||||
$this->rules[$row['name']] = unserialize($data);
|
||||
}
|
||||
|
||||
$query = (new Query)->from($this->itemChildTable);
|
||||
|
||||
Reference in New Issue
Block a user