diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index 34629920cc1c..afdbe1611dea 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -302,7 +302,8 @@ public function __construct(FileLocator $locator, Modules $moduleConfig, Routing // Normalize the path string in routeFiles array. foreach ($this->routeFiles as $routeKey => $routesFile) { - $this->routeFiles[$routeKey] = realpath($routesFile) ?: $routesFile; + $realpath = realpath($routesFile); + $this->routeFiles[$routeKey] = ($realpath === false) ? $routesFile : $realpath; } }