Skip to content

Commit

Permalink
Merge pull request #287 from gs11/issue284
Browse files Browse the repository at this point in the history
Removed trailing slash in subdirectory path added by CakePHP for some folders
  • Loading branch information
lGuillaume124 authored Jul 14, 2017
2 parents 75b1ff6 + f5e2acc commit 4bb64cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Controller/SongsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4bb64cf

Please sign in to comment.