Skip to content

Commit

Permalink
Cannot unpack arrays with string keys. Fixes #1057
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Jun 7, 2018
1 parent 4f13dff commit 2d5be73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions system/HTTP/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,9 @@ protected function sendCookies()

foreach ($this->cookies as $params)
{
// PHP cannot unpack array with string keys
$params = array_values($params);

setcookie(...$params);
}
}
Expand Down
5 changes: 1 addition & 4 deletions system/Helpers/cookie_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ function set_cookie($name, string $value = '', string $expire = '', string $doma
// The following line shows as a syntax error in NetBeans IDE
//(\Config\Services::response())->setcookie
$response = \Config\Services::response();
$response->setcookie
(
$name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly
);
$response->setcookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly);
}

}
Expand Down

0 comments on commit 2d5be73

Please sign in to comment.