10000 [Finder] fixed root directory access for ftp/sftp wrapper by DerDu · Pull Request #28604 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Finder] fixed root directory access for ftp/sftp wrapper #28604

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

Merged
merged 1 commit into from
Oct 3, 2018
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
[Finder] fixed root directory access for ftp/sftp wrapper
  • Loading branch information
DerDu authored and fabpot committed Oct 3, 2018
commit 9630a38d67811b1849293d29e18b7039b5507c33
10 changes: 9 additions & 1 deletion src/Symfony/Component/Finder/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,20 @@ private function searchInDirectory($dir)
/**
* Normalizes given directory names by removing trailing slashes.
*
* Excluding: (s)ftp:// wrapper
*
* @param string $dir
*
* @return string
*/
private function normalizeDir($dir)
{
return rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);

if (preg_match('#^s?ftp://#', $dir)) {
$dir .= '/';
}

return $dir;
}
}
0