From 5502e392e1fc4f93fad07b96bedcd3b269630006 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 7 Apr 2017 11:02:45 -0400 Subject: [PATCH] Fix incorrect type matching in Response::cookie() --- src/Http/Response.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Http/Response.php b/src/Http/Response.php index adcd5159cbc..6a8ea6d32c4 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -1942,7 +1942,7 @@ public function cookie($options = null) return $this->_cookies->get($options)->toArrayResponse(); } - $defaults = [ + $options += [ 'name' => 'CakeCookie[default]', 'value' => '', 'expire' => 0, @@ -1951,11 +1951,10 @@ public function cookie($options = null) 'secure' => false, 'httpOnly' => false ]; - $options += $defaults; $cookie = new Cookie( $options['name'], $options['value'], - $options['expire'], + (int)$options['expire'], $options['path'], $options['domain'], $options['secure'], @@ -2013,7 +2012,7 @@ public function withCookie($name, $data = '') $cookie = new Cookie( $name, $data['value'], - $data['expire'], + (int)$data['expire'], $data['path'], $data['domain'], $data['secure'],