Skip to content

[FileSystem] makePathRelative incorrect output when $startPath has ".." in it #22083

@motammem

Description

@motammem
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.0
$endPath = 'C:\web\js\app.js';
$startPath = 'C:\web\css\..\\';
$filesystem->makePathRelative($endPath, $startPath);

Expected output is js\app.js but this snippet outputs ../../js/app.js/.

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