Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] QuestionHelper::getHiddenResponse() not working with space in project directory name #40190

Closed
@Yendric

Description

@Yendric

(This is my first ever GitHub issue, so let me know if I'm doing anything wrong!)

Symfony version(s) affected: symfony/console ^5.2.3 (latest)

Description
When using the getHiddenResponse method of the QuestionHelper class (which is called when running askQuestion with a hidden question) in a project of which the location has a space in it, it will error out and try to execute the first part of the project location, eg.:
My project is located in 'D:\My Projects\My Cool Project', it will try to execute 'D:\My'.

How to reproduce
Create a php application with the Symfony console component inside of a folder with a space in the name (see example above). Then run askQuestion with a Question object that has hidden set to true.

Possible Solution
Changing this line: $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; to this: $exe = '"' . __DIR__ . '/../Resources/bin/hiddeninput.exe' . '"'; in Helper\QuestionHelper.php line 405.
This should fix the problem stated above.

Additional context
I found this 'bug' in Laravel 8 on Windows whilst trying to create a console command with a secret input.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions