From b4fa7e38b99d0bcf2515455d4e4f426f890dc63e Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 10 Oct 2019 12:25:28 -0700 Subject: [PATCH] Selfupgrade CLI: Fixed broken selfupgrade assets reference (fixes #2681) --- CHANGELOG.md | 1 + system/src/Grav/Common/GPM/Response.php | 3 ++- system/src/Grav/Console/Gpm/SelfupgradeCommand.php | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92263bf20..29de3baaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Fixed fatal error if there are numeric folders in `Flex Pages` * Fixed error on missing `Flex` templates in if `Flex Objects` plugin isn't installed * Grav 1.7: Fixed PHP 7.1 compatibility issues + * Selfupgrade CLI: Fixed broken selfupgrade assets reference [#2681](https://github.com/getgrav/grav/issues/2681) # v1.7.0-beta.10 ## 10/03/2019 diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index 72276076d..fead16899 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -135,7 +135,8 @@ class Response if (!$settings['verify_peer']) { $overrides = array_replace_recursive([], $overrides, [ 'curl' => [ - CURLOPT_SSL_VERIFYPEER => $settings['verify_peer'] + CURLOPT_SSL_VERIFYPEER => $settings['verify_peer'], + CURLOPT_SSL_VERIFYHOST => false ], 'fopen' => [ 'ssl' => [ diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index 6ecdda808..1562f4b66 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -185,17 +185,17 @@ class SelfupgradeCommand extends ConsoleCommand { $tmp_dir = Grav::instance()['locator']->findResource('tmp://', true, true); $this->tmp = $tmp_dir . '/Grav-' . uniqid('', false); - $output = Response::get($package->download, [], [$this, 'progress']); + $output = Response::get($package['download'], [], [$this, 'progress']); Folder::create($this->tmp); $this->output->write("\x0D"); - $this->output->write(" |- Downloading upgrade [{$this->formatBytes($package->size)}]... 100%"); + $this->output->write(" |- Downloading upgrade [{$this->formatBytes($package['size'])}]... 100%"); $this->output->writeln(''); - file_put_contents($this->tmp . DS . $package->name, $output); + file_put_contents($this->tmp . DS . $package['name'], $output); - return $this->tmp . DS . $package->name; + return $this->tmp . DS . $package['name']; } /**