diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-06-26 20:37:36 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-06-26 20:37:50 -0400 |
commit | 79da782892282ffc6390953fdcf2d496c6adc0fd (patch) | |
tree | fb428b51eeb3a50a0b82a95475c865817a3c4df1 | |
parent | 3edc40a68a7cf576d7197328e57c001d1667ae39 (diff) | |
download | nextcloud-server-79da782892282ffc6390953fdcf2d496c6adc0fd.tar.gz nextcloud-server-79da782892282ffc6390953fdcf2d496c6adc0fd.zip |
Improve error handling of Dropbox storage backend
-rwxr-xr-x | apps/files_external/lib/dropbox.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 5e94277c6d4..6f1a154a122 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -41,7 +41,11 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common { return $this->metaData[$path]; } else { if ($list) { - $response = $this->dropbox->getMetaData($path); + try { + $response = $this->dropbox->getMetaData($path); + } catch (Exception $exception) { + return false; + } if ($response && isset($response['contents'])) { $contents = $response['contents']; // Cache folder's contents @@ -90,7 +94,7 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common { if ($metaData = $this->getMetaData($path)) { $stat['size'] = $metaData['bytes']; $stat['atime'] = time(); - $stat['mtime'] = strtotime($metaData['modified']); + $stat['mtime'] = (isset($metaData['modified'])) ? strtotime($metaData['modified']) : time(); $stat['ctime'] = $stat['mtime']; return $stat; } @@ -111,11 +115,11 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common { } public function is_readable($path) { - return true; + return self::file_exists($path); } public function is_writable($path) { - return true; + return self::file_exists($path); } public function file_exists($path) { |