Skip to content

space character in filename is URL-encoded #3184

Description

@neil-pearce

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

  1. Create a directory path containing a sub-directory with a space in the name
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions