Skip to content

Commit

Permalink
Fixed verify peer default value and issue with fopen
Browse files Browse the repository at this point in the history
  • Loading branch information
w00fz committed Sep 23, 2016
1 parent 584f4ef commit c4f71c9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions system/src/Grav/Common/GPM/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function get($uri = '', $options = [], $callback = null)
// SSL Verify Peer and Proxy Setting
$settings = [
'method' => $config->get('system.gpm.method', self::$method),
'verify_peer' => $config->get('system.gpm.verify_peer', true),
'verify_peer' => $config->get('system.gpm.verify_peer'),
// `system.proxy_url` is for fallback
// introduced with 1.1.0-beta.1 probably safe to remove at some point
'proxy_url' => $config->get('system.gpm.proxy_url', $config->get('system.proxy_url', false)),
Expand Down Expand Up @@ -261,7 +261,14 @@ private static function getFopen()
$options['fopen']['notification'] = ['self', 'progress'];
}

$stream = stream_context_create(['http' => $options['fopen']], $options['fopen']);
$ssl = $options['fopen']['ssl'];
unset($options['fopen']['ssl']);

$stream = stream_context_create([
'http' => $options['fopen'],
'ssl' => $ssl
], $options['fopen']);

$content = @file_get_contents($uri, false, $stream);

if ($content === false) {
Expand Down

0 comments on commit c4f71c9

Please sign in to comment.