]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make DAV external storage test more reliable 3238/head
authorRobin Appelman <robin@icewind.nl>
Tue, 24 Jan 2017 15:56:24 +0000 (16:56 +0100)
committerRobin Appelman <robin@icewind.nl>
Tue, 24 Jan 2017 15:56:24 +0000 (16:56 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Storage/Common.php
lib/private/Files/Storage/DAV.php

index 5561f6a889b8b359d7c93d658b5641c94503c326..f3e3cb9e58c6d587a58febcca99b9d8a1d97061a 100644 (file)
@@ -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;
        }
 
        /**
index abe219f99f2dffc2834e1b2bb688623d6de14b45..3b89a66d6a2ceab97f346bbd03b03df7edf72d82 100644 (file)
@@ -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']),