|
|
@ -148,7 +148,7 @@ class Request
|
|
|
|
$config = [
|
|
|
|
$config = [
|
|
|
|
'url' => str_replace('@', '%40', self::getVar('REQUEST_URI', '/')),
|
|
|
|
'url' => str_replace('@', '%40', self::getVar('REQUEST_URI', '/')),
|
|
|
|
'base' => str_replace(['\\', ' '], ['/', '%20'], \dirname(self::getVar('SCRIPT_NAME'))),
|
|
|
|
'base' => str_replace(['\\', ' '], ['/', '%20'], \dirname(self::getVar('SCRIPT_NAME'))),
|
|
|
|
'method' => self::getMethod(),
|
|
|
|
'method' => ($config['method'] ?? self::getMethod()),
|
|
|
|
'referrer' => self::getVar('HTTP_REFERER'),
|
|
|
|
'referrer' => self::getVar('HTTP_REFERER'),
|
|
|
|
'ip' => self::getVar('REMOTE_ADDR'),
|
|
|
|
'ip' => self::getVar('REMOTE_ADDR'),
|
|
|
|
'ajax' => 'XMLHttpRequest' === self::getVar('HTTP_X_REQUESTED_WITH'),
|
|
|
|
'ajax' => 'XMLHttpRequest' === self::getVar('HTTP_X_REQUESTED_WITH'),
|
|
|
@ -181,7 +181,7 @@ class Request
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Set all the defined properties
|
|
|
|
// Set all the defined properties
|
|
|
|
foreach ($properties as $name => $value) {
|
|
|
|
foreach ($properties as $name => $value) {
|
|
|
|
$this->$name = $value;
|
|
|
|
$this->{$name} = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get the requested URL without the base directory
|
|
|
|
// Get the requested URL without the base directory
|
|
|
@ -229,7 +229,7 @@ class Request
|
|
|
|
return $body;
|
|
|
|
return $body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$method = self::getMethod();
|
|
|
|
$method = $this->method ?? self::getMethod();
|
|
|
|
|
|
|
|
|
|
|
|
if ('POST' === $method || 'PUT' === $method || 'DELETE' === $method || 'PATCH' === $method) {
|
|
|
|
if ('POST' === $method || 'PUT' === $method || 'DELETE' === $method || 'PATCH' === $method) {
|
|
|
|
$body = file_get_contents($this->stream_path);
|
|
|
|
$body = file_get_contents($this->stream_path);
|
|
|
|