diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index 3c08958604d2..d01202309a69 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -297,7 +297,7 @@ public function __construct(FileLocatorInterface $locator, Modules $moduleConfig // Normalize the path string in routeFiles array. foreach ($this->routeFiles as $routeKey => $routesFile) { $realpath = realpath($routesFile); - $this->routeFiles[$routeKey] = ($realpath === false) ? $routesFile : $realpath; + $this->routeFiles[$routeKey] = ($realpath === false) ? $routesFile : str_replace('\\', '/', $realpath); } } @@ -316,7 +316,7 @@ public function loadRoutes(string $routesFile = APPPATH . 'Config/Routes.php') // Normalize the path string in routesFile $realpath = realpath($routesFile); - $routesFile = ($realpath === false) ? $routesFile : $realpath; + $routesFile = ($realpath === false) ? $routesFile : str_replace('\\', '/', $realpath); // Include the passed in routesFile if it doesn't exist. // Only keeping that around for BC purposes for now.