Skip to content

Commit

Permalink
Fix issue with file name not being read correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rdgout committed Sep 16, 2020
1 parent 035ce86 commit 1dcbf57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1dcbf57

Please sign in to comment.