浏览代码

fix for php8.1

walkor 4 年之前
父节点
当前提交
12f9367d02
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Protocols/Http/Request.php

+ 2 - 1
Protocols/Http/Request.php

@@ -163,7 +163,8 @@ class Request
     public function cookie($name = null, $default = null)
     {
         if (!isset($this->_data['cookie'])) {
-            \parse_str(\str_replace('; ', '&', $this->header('cookie')), $this->_data['cookie']);
+            $this->_data['cookie'] = array();
+            \parse_str(\str_replace('; ', '&', $this->header('cookie', '')), $this->_data['cookie']);
         }
         if ($name === null) {
             return $this->_data['cookie'];