diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index 1c094d728872..d27d52fdc576 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -205,7 +205,7 @@ HTTP Method - getMethod())) ?> + getMethod()) ?> IP Address diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index 0f66f060f349..12c1930279e2 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -128,7 +128,7 @@ public function exceptionHandler(Throwable $exception) if ($this->config->log === true && ! in_array($statusCode, $this->config->ignoreCodes, true)) { $uri = $this->request->getPath() === '' ? '/' : $this->request->getPath(); - $routeInfo = '[Method: ' . strtoupper($this->request->getMethod()) . ', Route: ' . $uri . ']'; + $routeInfo = '[Method: ' . $this->request->getMethod() . ', Route: ' . $uri . ']'; log_message('critical', "{message}\n{routeInfo}\nin {exFile} on line {exLine}.\n{trace}", [ 'message' => $exception->getMessage(), diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index 4a7a20632fd7..b2d54c5d52cc 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -79,7 +79,7 @@ public function run(float $startTime, float $totalTime, RequestInterface $reques $data = []; // Data items used within the view. $data['url'] = current_url(); - $data['method'] = strtoupper($request->getMethod()); + $data['method'] = $request->getMethod(); $data['isAJAX'] = $request->isAJAX(); $data['startTime'] = $startTime; $data['totalTime'] = $totalTime * 1000; diff --git a/system/Security/Security.php b/system/Security/Security.php index 4ba665639f36..3868b19f8d84 100644 --- a/system/Security/Security.php +++ b/system/Security/Security.php @@ -280,7 +280,7 @@ public function getCSRFTokenName(): string public function verify(RequestInterface $request) { // Protects POST, PUT, DELETE, PATCH - $method = strtoupper($request->getMethod()); + $method = $request->getMethod(); $methodsToProtect = ['POST', 'PUT', 'DELETE', 'PATCH']; if (! in_array($method, $methodsToProtect, true)) { return $this; diff --git a/system/Validation/Validation.php b/system/Validation/Validation.php index 747ac66d9bc4..ae4f030907b4 100644 --- a/system/Validation/Validation.php +++ b/system/Validation/Validation.php @@ -501,7 +501,7 @@ public function withRequest(RequestInterface $request): ValidationInterface return $this; } - if (in_array(strtolower($request->getMethod()), ['put', 'patch', 'delete'], true) + if (in_array($request->getMethod(), ['PUT', 'PATCH', 'DELETE'], true) && strpos($request->getHeaderLine('Content-Type'), 'multipart/form-data') === false ) { $this->data = $request->getRawInput(); diff --git a/tests/system/HTTP/OutgoingRequestTest.php b/tests/system/HTTP/OutgoingRequestTest.php index 51b2bab6a3fe..d857297d49ef 100644 --- a/tests/system/HTTP/OutgoingRequestTest.php +++ b/tests/system/HTTP/OutgoingRequestTest.php @@ -44,8 +44,8 @@ public function testWithMethod(): void $newRequest = $request->withMethod('POST'); - $this->assertSame('GET', strtoupper($request->getMethod())); - $this->assertSame('POST', strtoupper($newRequest->getMethod())); + $this->assertSame('GET', $request->getMethod()); + $this->assertSame('POST', $newRequest->getMethod()); } public function testWithUri(): void