summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-01-26 18:43:36 +0100
committerGitHub <noreply@github.com>2017-01-26 18:43:36 +0100
commit29f5ab1758a3f0cfe9f0b11917e1873179d98a06 (patch)
tree6e6c729cbf2b6ce9a7cc20b02e44f70b62267daf /lib/private/Files
parentdd0d4698333ab126c786f62b9bd2df0f803bc394 (diff)
parent38ec2a35f2bfec8421578a778ec91d3901b279a1 (diff)
downloadnextcloud-server-29f5ab1758a3f0cfe9f0b11917e1873179d98a06.tar.gz
nextcloud-server-29f5ab1758a3f0cfe9f0b11917e1873179d98a06.zip
Merge pull request #3238 from nextcloud/dav-test
Make DAV external storage test more reliable
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Storage/Common.php10
-rw-r--r--lib/private/Files/Storage/DAV.php4
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']),