Fixes #13961: RBAC Rules: PostgreSQL: PHP Warning "unserialize() expects parameter 1 to be string, resource given" was fixed

This commit is contained in:
Vladimir Guts
2017-04-12 21:48:16 +03:00
committed by Alexander Makarov
parent 510cd3541d
commit d2fb17f444
2 changed files with 6 additions and 1 deletions

View File

@ -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);