mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 02:15:36 +08:00
also escape if it contains a space
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder;
|
namespace SPC\builder;
|
||||||
|
|
||||||
use PharIo\Version\BuildMetaData;
|
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\exception\RuntimeException;
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
@@ -84,7 +83,7 @@ class Extension
|
|||||||
*/
|
*/
|
||||||
public function getEnableArg(bool $shared = false): string
|
public function getEnableArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$escapedPath = str_contains(BUILD_ROOT_PATH, ' ') ? '"' . BUILD_ROOT_PATH . '"' : BUILD_ROOT_PATH;
|
$escapedPath = str_replace("'", '', escapeshellarg(BUILD_ROOT_PATH)) !== BUILD_ROOT_PATH || str_contains(BUILD_ROOT_PATH, ' ') ? '"' . BUILD_ROOT_PATH . '"' : BUILD_ROOT_PATH;
|
||||||
$_name = str_replace('_', '-', $this->name);
|
$_name = str_replace('_', '-', $this->name);
|
||||||
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
|
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
|
||||||
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',
|
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',
|
||||||
|
|||||||
Reference in New Issue
Block a user