diff --git a/Iterator/RecursiveDirectoryIterator.php b/Iterator/RecursiveDirectoryIterator.php index a1225fc..ac5d720 100644 --- a/Iterator/RecursiveDirectoryIterator.php +++ b/Iterator/RecursiveDirectoryIterator.php @@ -72,7 +72,7 @@ public function current() $subPathname .= $this->getFilename(); $basePath = $this->rootPath; - if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator)) { + if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator) && !str_ends_with($basePath, '/')) { $basePath .= $this->directorySeparator; }