From 1dcbf57a79137874ec8e0aed175db45a48dd75ce Mon Sep 17 00:00:00 2001 From: Rick Gout Date: Wed, 16 Sep 2020 09:28:35 +0200 Subject: [PATCH] Fix issue with file name not being read correctly --- src/Module.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Module.php b/src/Module.php index c115406..c6ff63f 100644 --- a/src/Module.php +++ b/src/Module.php @@ -258,12 +258,13 @@ private function registerRoutes(): void if (file_exists($routePath) && empty(($files = glob($routeFilePattern))) === false) { foreach ($files as $file) { + $fileName = basename($file); // Skip files that are not allowed route types - if (in_array(rtrim($file, '.php'), static::ROUTE_FILE_TYPES) === false) { + if (in_array(rtrim($fileName, '.php'), static::ROUTE_FILE_TYPES) === false) { continue; } - $path = sprintf('%s/%s', $routePath, basename($file)); + $path = sprintf('%s/%s', $routePath, $fileName); $this->loadRoutesFrom($path); }