[Pkg-owncloud-commits] [owncloud] 178/223: Better error handeling in testremote

David Prévot taffit at moszumanska.debian.org
Sun Jun 22 01:54:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit f2ebac5c768eef702d523c157d882bd7deb36930
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jun 17 13:15:34 2014 +0200

    Better error handeling in testremote
---
 apps/files_sharing/ajax/testremote.php | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/apps/files_sharing/ajax/testremote.php b/apps/files_sharing/ajax/testremote.php
index 3d9092a..8958179 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')) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list