summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-17 13:15:34 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-17 13:15:34 +0200
commitf2ebac5c768eef702d523c157d882bd7deb36930 (patch)
treeedacfd73c14fc80f1d9b03a5469109da165bd8e3
parent361607c72dd71eed482d1034f164d513ee66b8e6 (diff)
downloadnextcloud-server-f2ebac5c768eef702d523c157d882bd7deb36930.tar.gz
nextcloud-server-f2ebac5c768eef702d523c157d882bd7deb36930.zip
Better error handeling in testremote
-rw-r--r--apps/files_sharing/ajax/testremote.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_sharing/ajax/testremote.php b/apps/files_sharing/ajax/testremote.php
index 3d9092a034f..89581794698 100644
--- a/apps/files_sharing/ajax/testremote.php
+++ b/apps/files_sharing/ajax/testremote.php
@@ -11,9 +11,13 @@ OCP\JSON::checkAppEnabled('files_sharing');
$remote = $_GET['remote'];
function testUrl($url) {
- $result = file_get_contents($url);
- $data = json_decode($result);
- return is_object($data) and !empty($data->version);
+ try {
+ $result = file_get_contents($url);
+ $data = json_decode($result);
+ return is_object($data) and !empty($data->version);
+ } catch (Exception $e) {
+ return false;
+ }
}
if (testUrl('https://' . $remote . '/status.php')) {