Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed trailing slash in subdirectory path added by CakePHP for some folders #287

Merged
merged 1 commit into from
Jul 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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