Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  fix unix root dir issue
  sync validator translation files with master
  [HttpFoundation] fix not sending Content-Type header for 204 responses
  [ErrorHandler] silence warning when zend.assertions=-1
  fix anchor
  [Console] Handle zero row count in appendRow() for Table
  fix links to releases page (formerly known as "roadmap")
  [Console] Don't load same-namespace alternatives on exact match found
  • Loading branch information
fabpot committed Feb 14, 2020
2 parents 4176e7c + ea69c12 commit 6251f20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ private function searchInDirectory(string $dir): \Iterator
*/
private function normalizeDir(string $dir): string
{
if ('/' === $dir) {
return $dir;
}

$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);

if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {
Expand Down
6 changes: 5 additions & 1 deletion Iterator/RecursiveDirectoryIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ public function current()
}
$subPathname .= $this->getFilename();

return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
if ('/' !== $basePath = $this->rootPath) {
$basePath .= $this->directorySeparator;
}

return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname);
}

/**
Expand Down

0 comments on commit 6251f20

Please sign in to comment.