Bug #27995

Quote arguments in system command on Windows

Added by Bastian Waidelich over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Core
Target version:
-
Start date:
2011-07-08
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

The bootstrap currently does not quote system call arguments on Windows. This leads to errors if the path to your php binary contains spaces.

$command = 'SET FLOW3_ROOTPATH=' . FLOW3_PATH_ROOT . '&' . 'SET FLOW3_CONTEXT=' . $this->context . '&' . $this->settings['core']['phpBinaryPathAndFilename'] . ' -c ' . php_ini_loaded_file() . ' ' . FLOW3_PATH_FLOW3 . 'Scripts/flow3' . ' ' . escapeshellarg($commandIdentifier);

Should be changed to:

$command = 'SET FLOW3_ROOTPATH="' . FLOW3_PATH_ROOT . '"&' . 'SET FLOW3_CONTEXT="' . $this->context . '"&"' . $this->settings['core']['phpBinaryPathAndFilename'] . '" -c "' . php_ini_loaded_file() . '" "' . FLOW3_PATH_FLOW3 . 'Scripts/flow3' . ' ' . escapeshellarg($commandIdentifier) . '"';

TODO: Test


Related issues

Related to TYPO3.Flow - Bug #31779: Command execution on Windows breaks with special chars in pathClosedBastian Waidelich2011-11-12

Actions

Also available in: Atom PDF