From 3ee9f978261e80802ad0e30e8ccfb92187eab6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Tue, 19 Jan 2016 11:03:07 -0430 Subject: [PATCH] Trying to fix tests --- lib/Cake/Network/CakeRequest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index a12bac124..8860425ce 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -174,10 +174,10 @@ class CakeRequest implements ArrayAccess { $this->data = stripslashes_deep($this->data); } - $override = false; + $override = null; if (env('HTTP_X_HTTP_METHOD_OVERRIDE')) { $this->data['_method'] = env('HTTP_X_HTTP_METHOD_OVERRIDE'); - $override = true; + $override = $this->data['_method']; } $isArray = is_array($this->data); @@ -187,11 +187,11 @@ class CakeRequest implements ArrayAccess { } else { $_ENV['REQUEST_METHOD'] = $this->data['_method']; } + $override = $this->data['_method']; unset($this->data['_method']); - $override = true; } - if ($override && !in_array($_SERVER['REQUEST_METHOD'], ['POST', 'PUT', 'PATCH', 'DELETE'])) { + if ($override && !in_array($override, array('POST', 'PUT', 'PATCH', 'DELETE'))) { $this->data = array(); }