diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-02 08:01:16 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-04 06:58:59 +0300 |
commit | 1875570b37820ba411446bf28cfebb8e921763e3 (patch) | |
tree | 97c124c63777bd19738a97ec9e1de0b8cf67e365 /core/Http.php | |
parent | 1202d1a4f476e8d8abb7e62f5c282d249f5df10b (diff) |
Using HTTPS is now possible using the fopen method
Added tests, there's one failing need to find a solution.
Diffstat (limited to 'core/Http.php')
-rw-r--r-- | core/Http.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/Http.php b/core/Http.php index 25d6d59566..08bcbcef15 100644 --- a/core/Http.php +++ b/core/Http.php @@ -179,7 +179,7 @@ class Http throw new Exception('Malformed URL: ' . $aUrl); } - if ($url['scheme'] != 'http') { + if ($url['scheme'] != 'http' && $url['scheme'] != 'https') { throw new Exception('Invalid protocol/scheme: ' . $url['scheme']); } $host = $url['host']; @@ -405,7 +405,11 @@ class Http } fclose($handle); } else { - $response = file_get_contents($aUrl, 0, $ctx); + $response = @file_get_contents($aUrl, 0, $ctx); + if ($response === false) { + $error = error_get_last(); + throw new \Exception($error['message']); + } $fileLength = strlen($response); } |