|
|
@@ -175,7 +175,8 @@ class CakeRequest implements ArrayAccess {
|
|
|
if (env('HTTP_X_HTTP_METHOD_OVERRIDE')) {
|
|
|
$this->data['_method'] = env('HTTP_X_HTTP_METHOD_OVERRIDE');
|
|
|
}
|
|
|
- if (isset($this->data['_method'])) {
|
|
|
+ $isArray = is_array($this->data);
|
|
|
+ if ($isArray && isset($this->data['_method'])) {
|
|
|
if (!empty($_SERVER)) {
|
|
|
$_SERVER['REQUEST_METHOD'] = $this->data['_method'];
|
|
|
} else {
|
|
|
@@ -183,8 +184,7 @@ class CakeRequest implements ArrayAccess {
|
|
|
}
|
|
|
unset($this->data['_method']);
|
|
|
}
|
|
|
-
|
|
|
- if (isset($this->data['data'])) {
|
|
|
+ if ($isArray && isset($this->data['data'])) {
|
|
|
$data = $this->data['data'];
|
|
|
if (count($this->data) <= 1) {
|
|
|
$this->data = $data;
|