Make DAV external storage test more reliable

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-01-24 16:56:24 +01:00
parent f55260bc83
commit 38ec2a35f2
No known key found for this signature in database
GPG key ID: 50F2B59C6DEBBCFE
2 changed files with 9 additions and 5 deletions

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;
}
/**

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']),