diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index 40da9056b963..20f3804fb713 100755 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -49,18 +49,6 @@ */ class IncomingRequest extends Request { - /** - * Enable CSRF flag - * - * Enables a CSRF cookie token to be set. - * Set automatically based on Config setting. - * - * @var bool - * - * @deprecated Not used - */ - protected $enableCSRF = false; - /** * The URI for this request. * @@ -121,13 +109,6 @@ class IncomingRequest extends Request */ protected $validLocales = []; - /** - * Configuration settings. - * - * @var App - */ - protected $config; - /** * Holds the old data from a redirect. * @@ -172,7 +153,6 @@ public function __construct($config, ?URI $uri = null, $body = 'php://input', ?U $body = null; } - $this->config = $config; $this->uri = $uri; $this->body = $body; $this->userAgent = $userAgent; @@ -929,18 +909,4 @@ public function getFile(string $fileID) return $this->files->getFile($fileID); } - - /** - * Remove relative directory (../) and multi slashes (///) - * - * Do some final cleaning of the URI and return it, currently only used in static::_parse_request_uri() - * - * @deprecated 4.1.2 Use URI::removeDotSegments() directly - */ - protected function removeRelativeDirectory(string $uri): string - { - $uri = URI::removeDotSegments($uri); - - return $uri === '/' ? $uri : ltrim($uri, '/'); - } } diff --git a/system/HTTP/Request.php b/system/HTTP/Request.php index 007b0fcc56c9..125646b6c7c7 100644 --- a/system/HTTP/Request.php +++ b/system/HTTP/Request.php @@ -24,24 +24,15 @@ class Request extends OutgoingRequest implements RequestInterface { use RequestTrait; - /** - * Proxy IPs - * - * @var array - * - * @deprecated 4.0.5 No longer used. Check the App config directly - */ - protected $proxyIPs; - /** * Constructor. * * @param App $config - * - * @deprecated 4.0.5 The $config is no longer needed and will be removed in a future version */ - public function __construct($config = null) // @phpstan-ignore-line + public function __construct($config = null) { + $this->config = $config ?? config(App::class); + if (empty($this->method)) { $this->method = $this->getServer('REQUEST_METHOD') ?? Method::GET; } diff --git a/system/HTTP/RequestTrait.php b/system/HTTP/RequestTrait.php index ca3d0e550945..3f935ea6ab4c 100644 --- a/system/HTTP/RequestTrait.php +++ b/system/HTTP/RequestTrait.php @@ -27,6 +27,13 @@ */ trait RequestTrait { + /** + * Configuration settings. + * + * @var App + */ + protected $config; + /** * IP address of the current user. * @@ -61,7 +68,7 @@ public function getIPAddress(): string 'valid_ip', ]; - $proxyIPs = config(App::class)->proxyIPs; + $proxyIPs = $this->config->proxyIPs; if (! empty($proxyIPs) && (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs)))) { throw new ConfigException( diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 11c5a755c0ad..f0b24389f329 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -329,6 +329,9 @@ Request has been removed. - The visibility of the deprecated properties ``$uri`` and ``$config`` in ``IncomingRequest`` has been changed to protected. +- The ``$enableCSRF`` property in ``IncomingRequest`` has been removed. +- The ``removeRelativeDirectory()`` method in ``IncomingRequest`` has been removed. +- The ``$proxyIPs`` property in ``Request`` has been removed. Filters -------