mirror of
https://github.com/getgrav/grav.git
synced 2026-08-07 00:49:03 +02:00
Fixed bin/grav install command with arbitrary destination folder name
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
1. [](#bugfix)
|
||||
* Regression: Fixed saving page with a new language causing cache corruption [getgrav/grav-plugin-admin#2282](https://github.com/getgrav/grav-plugin-admin/issues/2282)
|
||||
* Fixed a potential fatal error when using watermark in images
|
||||
* Fixed `bin/grav install` command with arbitrary destination folder name
|
||||
|
||||
# v1.7.33
|
||||
## 04/25/2022
|
||||
|
||||
@@ -147,7 +147,7 @@ class InstallCommand extends GravCommand
|
||||
foreach ($this->config['git'] as $repo => $data) {
|
||||
$path = $this->destination . DS . $data['path'];
|
||||
if (!file_exists($path)) {
|
||||
exec('cd "' . $this->destination . '" && git clone -b ' . $data['branch'] . ' --depth 1 ' . $data['url'] . ' ' . $data['path'], $output, $return);
|
||||
exec('cd ' . escapeshellarg($this->destination) . ' && git clone -b ' . $data['branch'] . ' --depth 1 ' . $data['url'] . ' ' . $data['path'], $output, $return);
|
||||
|
||||
if (!$return) {
|
||||
$io->writeln('<green>SUCCESS</green> cloned <magenta>' . $data['url'] . '</magenta> -> <cyan>' . $path . '</cyan>');
|
||||
|
||||
@@ -288,7 +288,7 @@ trait ConsoleTrait
|
||||
{
|
||||
$composer = Composer::getComposerExecutor();
|
||||
|
||||
return system($composer . ' --working-dir="'.$path.'" --no-interaction --no-dev --prefer-dist -o '. $action);
|
||||
return system($composer . ' --working-dir=' . escapeshellarg($path) . ' --no-interaction --no-dev --prefer-dist -o '. $action);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -485,7 +485,7 @@ class InstallCommand extends GpmCommand
|
||||
{
|
||||
$io = $this->getIO();
|
||||
|
||||
exec('cd ' . $this->destination);
|
||||
exec('cd ' . escapeshellarg($this->destination));
|
||||
|
||||
$to = $this->destination . DS . $package->install_path;
|
||||
$from = $this->getSymlinkSource($package);
|
||||
|
||||
Reference in New Issue
Block a user