Explorar o código

fix for php8.1

walkor %!s(int64=4) %!d(string=hai) anos
pai
achega
12f9367d02
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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'];