From 6264330ffbf17c44f5865ef51a366d2e97d07401 Mon Sep 17 00:00:00 2001 From: Haotong Lin Date: Tue, 15 Dec 2015 16:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3cookie=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cookie.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/cookie.php b/library/think/cookie.php index 2954afe4..8a0ceca5 100644 --- a/library/think/cookie.php +++ b/library/think/cookie.php @@ -82,7 +82,7 @@ class Cookie $name = $config['prefix'] . $name; // 设置cookie if (is_array($value)) { - array_walk_recursive($value, $this->jsonFormatProtect, 'encode'); + array_walk_recursive($value, 'self::jsonFormatProtect', 'encode'); $value = 'think:' . json_encode($value); } $expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0; @@ -105,7 +105,7 @@ class Cookie if (0 === strpos($value, 'think:')) { $value = substr($value, 6); $value = json_decode($value, true); - array_walk_recursive($value, $this->jsonFormatProtect, 'decode'); + array_walk_recursive($value, 'self::jsonFormatProtect', 'decode'); } return $value; } else {