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

Skip to content

FileSystem::makePathRelative is broken when resolving less than two path elements #19482

Closed
@drm

Description

@drm

Running:

$f = new Symfony\Component\Filesystem\Filesystem();
echo $f->makePathRelative('/home/user', '/var'), "\n";

gives:

home/user

Expected is: ../home/user.

However,

$f = new Symfony\Component\Filesystem\Filesystem();
echo $f->makePathRelative('/home/user/drm', '/usr/local'), "\n";

gives the expected ../../home/user/drm/

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