Skip to content

Commit 1dcbf57

Browse files
committed
Fix issue with file name not being read correctly
1 parent 035ce86 commit 1dcbf57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Module.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,13 @@ private function registerRoutes(): void
258258

259259
if (file_exists($routePath) && empty(($files = glob($routeFilePattern))) === false) {
260260
foreach ($files as $file) {
261+
$fileName = basename($file);
261262
// Skip files that are not allowed route types
262-
if (in_array(rtrim($file, '.php'), static::ROUTE_FILE_TYPES) === false) {
263+
if (in_array(rtrim($fileName, '.php'), static::ROUTE_FILE_TYPES) === false) {
263264
continue;
264265
}
265266

266-
$path = sprintf('%s/%s', $routePath, basename($file));
267+
$path = sprintf('%s/%s', $routePath, $fileName);
267268

268269
$this->loadRoutesFrom($path);
269270
}

0 commit comments

Comments
 (0)