From 622192acd761cd750694907580c3dace8653725c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 17 Nov 2017 14:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=BC=82=E5=B8=B8=E6=8D=95?= =?UTF-8?q?=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Redis.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/think/cache/driver/Redis.php b/library/think/cache/driver/Redis.php index b3002c1e..90da6551 100644 --- a/library/think/cache/driver/Redis.php +++ b/library/think/cache/driver/Redis.php @@ -84,7 +84,13 @@ class Redis extends Driver return $default; } - return unserialize($value); + try { + $result = unserialize($value); + } catch (\Exception $e) { + $result = $default; + } + + return $result; } /**