This repository was archived by the owner on Aug 14, 2021. It is now read-only.
Open
Conversation
…eding '\' on Windows systems, breaking URLS
1 similar comment
Owner
|
Seems that your change is breaking the tests. Can you take a look at it? The main problem I see is that the url your change generates has the file path (index.html for example) when it should end at the folder level. |
Author
|
Yeah, seems, basename isn't the way to go. I can't run the tests atm since in a Windows machine, they won't pass in the first place. Could simply replace the first character if dirname() with '/', but dirname() doesn't actually always return a string starting with '/', so counting on that would be a mistake as well and it would be a dirty solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dirname()seems to be specifically meant for local filesystem operations. On windows, it adds a '\' at the beginning of the returned string, breaking URLs, since the resulted absolute URL looks likehttp://site.tld/\dirname/then.'/' . basename(...)seems to work as a replacement that also works on Windows