diff --git a/app/Controller/SongsController.php b/app/Controller/SongsController.php index 90b3203..e7002e8 100644 --- a/app/Controller/SongsController.php +++ b/app/Controller/SongsController.php @@ -55,7 +55,13 @@ public function import() { // The find method does not return absolute paths. foreach ($found_in_this_directory as $key => $value) { - $found_in_this_directory[$key] = $subdirectory->path . '/' . $value; + + // CakePHP adds a trailing slash when the path contains two dots in sequence + if(substr($subdirectory->path, -1) === '/') { + $found_in_this_directory[$key] = $subdirectory->path . $value; + } else { + $found_in_this_directory[$key] = $subdirectory->path . '/' . $value; + } } $found = array_merge($found, $found_in_this_directory);