From 848592011bba4229f89a7c85e181618a08a973cd Mon Sep 17 00:00:00 2001 From: sgiehl <stefan@piwik.org> Date: Sat, 5 Sep 2015 18:31:20 +0200 Subject: [PATCH] fixes #8707 - throw exception when url is not reachable --- core/Http.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Http.php b/core/Http.php index df9df3e5aa..b5533262e4 100644 --- a/core/Http.php +++ b/core/Http.php @@ -426,7 +426,9 @@ class Http // save to file if (is_resource($file)) { - $handle = fopen($aUrl, 'rb', false, $ctx); + if (!($handle = fopen($aUrl, 'rb', false, $ctx))) { + throw new Exception("Unable to open $aUrl"); + } while (!feof($handle)) { $response = fread($handle, 8192); $fileLength += strlen($response); -- GitLab