Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[filesystem] makeRelativePath does not work correctly from root #14066

Closed
@jaytaph

Description

@jaytaph

When using makeRelativePath, it returns an incorrect path when trying to fetch an entry from the root:

  $fs->makePathRelative('/foo/bar/baz', '/');

Actual result:

  ../foo/bar/baz

Expected result:

  foo/bar/baz

As we have specified an absolute path, there is no point on having an .. added. It works, because a root directory has a .. which points to itself, but it could result in issues when the relative path is actually prefixed or concatted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions