8000 [Finder] fixed root directory access for ftp/sftp wrapper · symfony/symfony@9630a38 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9630a38

Browse files
DerDufabpot
authored andcommitted
[Finder] fixed root directory access for ftp/sftp wrapper
1 parent 2a605c2 commit 9630a38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Symfony/Component/Finder/Finder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,20 @@ private function searchInDirectory($dir)
732732
/**
733733
* Normalizes given directory names by removing trailing slashes.
734734
*
735+
* Excluding: (s)ftp:// wrapper
736+
*
735737
* @param string $dir
736738
*
737739
* @return string
738740
*/
739741
private function normalizeDir($dir)
740742
{
741-
return rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
743+
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
744+
745+
if (preg_match('#^s?ftp://#', $dir)) {
746+
$dir .= '/';
747+
}
748+
749+
return $dir;
742750
}
743751
}

0 commit comments

Comments
 (0)
0