mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 18:47:33 +08:00 
			
		
		
		
	Fix #19670: Fix Error null check PHP 8.1 yii\rbac\DbManager
				
					
				
			This commit is contained in:
		| @ -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) | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Samuele Renati
					Samuele Renati