Skip to content

Commit

Permalink
./ !== root
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmldr committed Feb 6, 2021
1 parent bc64eea commit 95198ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function path(string ...$args): string
$path = implode('/', $parts);

// Leading slash
if (strpos($arguments[0], '/') === 0 || strpos($arguments[0], './') === 0) {
if (strpos($arguments[0], '/') === 0) {
$path = '/' . $path;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/PathHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testRemovalCurrentDirectoryReference(): void
{
self::assertEquals('foo/bar/baz', PathHelper::path('foo/././bar/./baz'));
self::assertEquals('/foo/bar/baz/', PathHelper::path('/foo/././bar/./baz/'));
self::assertEquals('/foo/bar/baz', PathHelper::path('./foo/././bar/./baz'));
self::assertEquals('foo/bar/baz', PathHelper::path('./foo/././bar/./baz'));
self::assertEquals('/foo/bar/baz', PathHelper::path('/./foo/././bar/./baz'));
}

Expand Down

0 comments on commit 95198ba

Please sign in to comment.