diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-17 12:47:26 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-03-26 10:59:58 +0200 |
commit | 3668673d7b3f64a5aaa80f569856b88460d9a522 (patch) | |
tree | 1767767ac8889e6001b9fca4f7670c237c28b158 /lib/private/Updater | |
parent | f3917cfea148d09832a727953c74ece952a47f84 (diff) | |
download | nextcloud-server-3668673d7b3f64a5aaa80f569856b88460d9a522.tar.gz nextcloud-server-3668673d7b3f64a5aaa80f569856b88460d9a522.zip |
Create a notification when the update server couldn't be reached for some days
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Updater')
-rw-r--r-- | lib/private/Updater/VersionCheck.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/private/Updater/VersionCheck.php b/lib/private/Updater/VersionCheck.php index ae3840a7fa5..3518f40bd4f 100644 --- a/lib/private/Updater/VersionCheck.php +++ b/lib/private/Updater/VersionCheck.php @@ -82,7 +82,12 @@ class VersionCheck { $url = $updaterUrl . '?version=' . $versionString; $tmp = []; - $xml = $this->getUrlContent($url); + try { + $xml = $this->getUrlContent($url); + } catch (\Exception $e) { + return false; + } + if ($xml) { $loadEntities = libxml_disable_entity_loader(true); $data = @simplexml_load_string($xml); @@ -108,16 +113,13 @@ class VersionCheck { /** * @codeCoverageIgnore * @param string $url - * @return bool|resource|string + * @return resource|string + * @throws \Exception */ protected function getUrlContent($url) { - try { - $client = $this->clientService->newClient(); - $response = $client->get($url); - return $response->getBody(); - } catch (\Exception $e) { - return false; - } + $client = $this->clientService->newClient(); + $response = $client->get($url); + return $response->getBody(); } } |