Skip to content

Commit

Permalink
do not duplicate directory separators
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Aug 5, 2024
1 parent 4f3b0f7 commit 7f159e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Iterator/RecursiveDirectoryIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7f159e1

Please sign in to comment.