mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
修正cookie类的错误
This commit is contained in:
@@ -82,7 +82,7 @@ class Cookie
|
|||||||
$name = $config['prefix'] . $name;
|
$name = $config['prefix'] . $name;
|
||||||
// 设置cookie
|
// 设置cookie
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
array_walk_recursive($value, $this->jsonFormatProtect, 'encode');
|
array_walk_recursive($value, 'self::jsonFormatProtect', 'encode');
|
||||||
$value = 'think:' . json_encode($value);
|
$value = 'think:' . json_encode($value);
|
||||||
}
|
}
|
||||||
$expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0;
|
$expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0;
|
||||||
@@ -105,7 +105,7 @@ class Cookie
|
|||||||
if (0 === strpos($value, 'think:')) {
|
if (0 === strpos($value, 'think:')) {
|
||||||
$value = substr($value, 6);
|
$value = substr($value, 6);
|
||||||
$value = json_decode($value, true);
|
$value = json_decode($value, true);
|
||||||
array_walk_recursive($value, $this->jsonFormatProtect, 'decode');
|
array_walk_recursive($value, 'self::jsonFormatProtect', 'decode');
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user