diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php
index 4477ee08ff8b..693afed491f5 100644
--- a/app/Views/errors/html/error_exception.php
+++ b/app/Views/errors/html/error_exception.php
@@ -195,7 +195,7 @@
Path |
- = esc($request->uri) ?> |
+ = esc($request->getUri()) ?> |
HTTP Method |
diff --git a/system/Common.php b/system/Common.php
index 7c150a01c1d4..32943189b56b 100644
--- a/system/Common.php
+++ b/system/Common.php
@@ -480,9 +480,9 @@ function force_https(int $duration = 31536000, ?RequestInterface $request = null
$uri = URI::createURIString(
'https',
$baseURL,
- $request->uri->getPath(), // Absolute URIs should use a "/" for an empty path
- $request->uri->getQuery(),
- $request->uri->getFragment()
+ $request->getUri()->getPath(), // Absolute URIs should use a "/" for an empty path
+ $request->getUri()->getQuery(),
+ $request->getUri()->getFragment()
);
// Set an HSTS header
diff --git a/tests/system/HTTP/IncomingRequestTest.php b/tests/system/HTTP/IncomingRequestTest.php
index b467c9ca3e1a..3b14c6a03357 100644
--- a/tests/system/HTTP/IncomingRequestTest.php
+++ b/tests/system/HTTP/IncomingRequestTest.php
@@ -650,6 +650,6 @@ public function testSetPathUpdatesURI()
$request->setPath('apples');
- $this->assertSame('apples', $request->uri->getPath());
+ $this->assertSame('apples', $request->getUri()->getPath());
}
}
diff --git a/tests/system/HTTP/URITest.php b/tests/system/HTTP/URITest.php
index acd491bccb9d..0438505aea2e 100644
--- a/tests/system/HTTP/URITest.php
+++ b/tests/system/HTTP/URITest.php
@@ -876,14 +876,14 @@ public function testBasedNoIndex()
// going through request
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $request->uri);
- $this->assertSame('/ci/v4/controller/method', $request->uri->getPath());
+ $this->assertSame('/ci/v4/controller/method', $request->getUri()->getPath());
// standalone
$uri = new URI('http://example.com/ci/v4/controller/method');
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $uri);
$this->assertSame('/ci/v4/controller/method', $uri->getPath());
- $this->assertSame($uri->getPath(), $request->uri->getPath());
+ $this->assertSame($uri->getPath(), $request->getUri()->getPath());
}
public function testBasedWithIndex()
@@ -902,15 +902,15 @@ public function testBasedWithIndex()
Services::injectMock('request', $request);
// going through request
- $this->assertSame('http://example.com/ci/v4/index.php/controller/method', (string) $request->uri);
- $this->assertSame('/ci/v4/index.php/controller/method', $request->uri->getPath());
+ $this->assertSame('http://example.com/ci/v4/index.php/controller/method', (string) $request->getUri());
+ $this->assertSame('/ci/v4/index.php/controller/method', $request->getUri()->getPath());
// standalone
$uri = new URI('http://example.com/ci/v4/index.php/controller/method');
$this->assertSame('http://example.com/ci/v4/index.php/controller/method', (string) $uri);
$this->assertSame('/ci/v4/index.php/controller/method', $uri->getPath());
- $this->assertSame($uri->getPath(), $request->uri->getPath());
+ $this->assertSame($uri->getPath(), $request->getUri()->getPath());
}
public function testForceGlobalSecureRequests()
@@ -933,13 +933,13 @@ public function testForceGlobalSecureRequests()
Services::injectMock('request', $request);
// Detected by request
- $this->assertSame('https://example.com/ci/v4/controller/method', (string) $request->uri);
+ $this->assertSame('https://example.com/ci/v4/controller/method', (string) $request->getUri());
// Standalone
$uri = new URI('http://example.com/ci/v4/controller/method');
$this->assertSame('https://example.com/ci/v4/controller/method', (string) $uri);
- $this->assertSame(trim($uri->getPath(), '/'), trim($request->uri->getPath(), '/'));
+ $this->assertSame(trim($uri->getPath(), '/'), trim($request->getUri()->getPath(), '/'));
}
public function testZeroAsURIPath()