diff options
author | Robin Appelman <robin@icewind.nl> | 2017-01-24 16:56:24 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-01-24 16:56:24 +0100 |
commit | 38ec2a35f2bfec8421578a778ec91d3901b279a1 (patch) | |
tree | ddfa5574a5021399236b2030a0361da0bf6fdb1e /lib | |
parent | f55260bc83feeb76ae662c7b97d092da83d8b6bb (diff) | |
download | nextcloud-server-38ec2a35f2bfec8421578a778ec91d3901b279a1.tar.gz nextcloud-server-38ec2a35f2bfec8421578a778ec91d3901b279a1.zip |
Make DAV external storage test more reliable
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Common.php | 10 | ||||
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 5561f6a889b..f3e3cb9e58c 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -436,10 +436,14 @@ abstract class Common implements Storage, ILockingStorage { * @return bool */ public function test() { - if ($this->stat('')) { - return true; + try { + if ($this->stat('')) { + return true; + } + return false; + } catch (\Exception $e) { + return false; } - return false; } /** diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index abe219f99f2..3b89a66d6a2 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -569,8 +569,8 @@ class DAV extends Common { public function stat($path) { try { $response = $this->propfind($path); - if ($response === false) { - return []; + if (!$response) { + return false; } return [ 'mtime' => strtotime($response['{DAV:}getlastmodified']), |