Skip to content

Commit 1c6f6fe

Browse files
authored
Merge pull request #4496 from kenguest/master
Fix the issue where if CRedisCache's getValue method returns null, causing deprecation message when passed to unserialize
2 parents 9cf9369 + 1e302b8 commit 1c6f6fe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Version 1.1.28 under development
55
--------------------------------
66

77
- Bug #4491: Fixed limit and Offset not working correctly with MSSQL version 11 (2012) and newer (shnoulle, wtommyw)
8+
- Bug #4497: PHP 8.1 compatibility: Fix unserialize null in CRedisCache (kenguest, wtommyw)
89
- Bug #4500: PHP 8.1 compatibility: Fix deprecation warnings in CMysql classes (csears123)
910

1011
Version 1.1.27 November 21, 2022

framework/caching/CRedisCache.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ private function byteLength($str)
204204
*/
205205
protected function getValue($key)
206206
{
207-
return $this->executeCommand('GET',array($key));
207+
$value=$this->executeCommand('GET',array($key));
208+
if ($value===null)
209+
return false;
210+
return $value;
208211
}
209212

210213
/**

0 commit comments

Comments
 (0)