Browse Source

Merge pull request #3238 from nextcloud/dav-test

Make DAV external storage test more reliable
tags/v12.0.0beta1
Lukas Reschke 7 years ago
parent
commit
29f5ab1758
2 changed files with 9 additions and 5 deletions
  1. 7
    3
      lib/private/Files/Storage/Common.php
  2. 2
    2
      lib/private/Files/Storage/DAV.php

+ 7
- 3
lib/private/Files/Storage/Common.php View 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;
}

/**

+ 2
- 2
lib/private/Files/Storage/DAV.php View 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']),

Loading…
Cancel
Save