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
space character in filename is URL-encoded #3184
Comments
Hi ! Nobody ? |
Thanks for reporting this issue. You are right and this does seem to be an issue with using league/uri's path value object. This is a similar issue to #3247 and #3239; for some reason our test cases did not pick up on this. As mentioned in 3239, we'd need a bit of time to fix this because we resolve paths across operating systems but also across virtual filesystems. And since the problem may be in the nature of League URI's path object itself, I have a gut feeling that we need to rip that out and replace it with something that works better. |
A Draft PR is opened at #3253 containing at least a couple of test cases illustrating the issue. I still need to discern what more locations there may be, and what scenario's I am still missing |
Thank you for your research, I'm not sure I would have found this easily. My testcases also seem to indicate there is a similar issue in a non-windows environment. Which makes this even more interesting |
I was afraid that it wouldn't be a simple - I basically don't have a grasp of all the complexities. Thanks for picking it up |
The first few tries to fix it haven't worked so far; I need to refactor quite a bit because of assumption errors. It also doesn't help that our Windows unit tests won't run at the moment.. |
My problem is quite large: directory name, that's in Russian! |
Was this fixed? I have the same problem, trying to generate docs for a site hosted in Local, folder is inside "Local Sites", docs get generated in "Local%20Sites". Annoying to say the least. EDIT: actually, no docs are generated - the space messes everything up. |
Expected behavior
The current directory path should be able to contain a space character
Actual behavior
A space character results in %20 in the path name, eg a path containing the directory 'TEST DATA' results in 'TEST%20DATA' and the output and cache directories are generated with their default values (eg .phpdoc/cache) with a new parallel directory structure beginning at the URL encoded sub-directory is created for .phpdoc/build
Steps to reproduce the problem
Your environment
The issue is being caused because the function createFromWindowsPath in League\Uri is performing a rawurlencode on the elements of the filename:
$uri = implode('/', array_map('rawurlencode', explode('/', $uri)));
The attached file is one possible solution to the problem (note that WINDOWS_URI_FORMAT has been modified, in addition to the code changes):
createUri.txt
The text was updated successfully, but these errors were encountered: