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
- Create a directory path containing a sub-directory with a space in the name
- Run phpDocumentor from under that path
Your environment
- Version used: phpdocumentor-3.3.1-rc
- Install method: PHIVE
- PHP version: PHP 8.1.4 (cli) (built: Mar 16 2022 09:33:31) (ZTS Visual C++ 2019 x64)
- Operating system and version: Windows 10
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
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