Skip to content

Commit 44621eb

Browse files
authored
Merge pull request #4651 from MGatner/get-uri
2 parents 0307d48 + b2e6525 commit 44621eb

File tree

6 files changed

+396
-258
lines changed

6 files changed

+396
-258
lines changed

system/CodeIgniter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
400400
$filters->enableFilter($routeFilter, 'after');
401401
}
402402

403-
$uri = $this->request instanceof CLIRequest ? $this->request->getPath() : $this->request->getUri()->getPath();
403+
$uri = $this->determinePath();
404404

405405
// Never run filters when running through Spark cli
406406
if (! defined('SPARKED'))
@@ -846,8 +846,7 @@ protected function determinePath()
846846
return $this->path;
847847
}
848848

849-
// @phpstan-ignore-next-line
850-
return (is_cli() && ! (ENVIRONMENT === 'testing')) ? $this->request->getPath() : $this->request->uri->getPath();
849+
return method_exists($this->request, 'getPath') ? $this->request->getPath() : $this->request->getUri()->getPath();
851850
}
852851

853852
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)