diff --git a/system/Router/AutoRouterImproved.php b/system/Router/AutoRouterImproved.php index 7b03e705a1df..39b264ecf780 100644 --- a/system/Router/AutoRouterImproved.php +++ b/system/Router/AutoRouterImproved.php @@ -251,11 +251,7 @@ private function scanControllers(array $segments): array $c = count($segments); while ($c-- > 0) { - $segmentConvert = ucfirst( - $this->translateURIDashes === true - ? str_replace('-', '_', $segments[0]) - : $segments[0] - ); + $segmentConvert = $this->translateURIDashes(ucfirst($segments[0])); // as soon as we encounter any segment that is not PSR-4 compliant, stop searching if (! $this->isValidSegment($segmentConvert)) {