New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Filesystem] Several issues with Filesystem::makePathRelative #25023
Comments
@inso would you up to submit a PR to fix what you found? |
Hello, there is any update for this issue? Make relative path when the first argument is a file returns a wrong response, because it return a string with a slash at end. |
@lainosantos Would you like to work on a fix? |
@xabbuh , i'll do it. Thanks. |
Hey, thanks for your report! |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
The first issue has already been fixed in #36497. |
Looking at the code of Filesystem::makePathRelative method I have found several issues:
(new Filesystem())->makePathRelative('C:/aa/bb/cc', 'D:/aa/dd/..')
produces'bb/cc/'
(new Filesystem())->makePathRelative('/aa/bb/cc', '/aa')
produces'bb/cc/'
which is wrong since'/aa/bb/cc'
can be the file path, the presence of trailing slash in the result should be based on presence of trailing slash in the$endPath
argument.The text was updated successfully, but these errors were encountered: