Skip to content

Commit 4b7020f

Browse files
committed
also escape if it contains a space
1 parent f9a8231 commit 4b7020f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/SPC/builder/Extension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace SPC\builder;
66

7-
use PharIo\Version\BuildMetaData;
87
use SPC\exception\FileSystemException;
98
use SPC\exception\RuntimeException;
109
use SPC\exception\WrongUsageException;
@@ -84,7 +83,7 @@ public function getConfigureArg(bool $shared = false): string
8483
*/
8584
public function getEnableArg(bool $shared = false): string
8685
{
87-
$escapedPath = str_contains(BUILD_ROOT_PATH, ' ') ? '"' . BUILD_ROOT_PATH . '"' : BUILD_ROOT_PATH;
86+
$escapedPath = str_replace("'", '', escapeshellarg(BUILD_ROOT_PATH)) !== BUILD_ROOT_PATH || str_contains(BUILD_ROOT_PATH, ' ') ? '"' . BUILD_ROOT_PATH . '"' : BUILD_ROOT_PATH;
8887
$_name = str_replace('_', '-', $this->name);
8988
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
9089
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',

0 commit comments

Comments
 (0)