mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Trying to fix tests
This commit is contained in:
parent
dc83669e9b
commit
3ee9f97826
1 changed files with 4 additions and 4 deletions
|
@ -174,10 +174,10 @@ class CakeRequest implements ArrayAccess {
|
||||||
$this->data = stripslashes_deep($this->data);
|
$this->data = stripslashes_deep($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$override = false;
|
$override = null;
|
||||||
if (env('HTTP_X_HTTP_METHOD_OVERRIDE')) {
|
if (env('HTTP_X_HTTP_METHOD_OVERRIDE')) {
|
||||||
$this->data['_method'] = 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);
|
$isArray = is_array($this->data);
|
||||||
|
@ -187,11 +187,11 @@ class CakeRequest implements ArrayAccess {
|
||||||
} else {
|
} else {
|
||||||
$_ENV['REQUEST_METHOD'] = $this->data['_method'];
|
$_ENV['REQUEST_METHOD'] = $this->data['_method'];
|
||||||
}
|
}
|
||||||
|
$override = $this->data['_method'];
|
||||||
unset($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();
|
$this->data = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue