diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-12 20:53:45 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-12 20:53:45 +0200 |
commit | 27fcdb3af5d1b1012695a09e04c0a654a1dde710 (patch) | |
tree | 6de492454c862852de3f51bd8834e2012139b5ac /apps/files_external/lib/smb.php | |
parent | 46e5e9bd73a68f7b50bb79f883a8bc6efacaca97 (diff) | |
parent | 3584d48d65900b15dc3ef6831926f4a52e508625 (diff) | |
download | nextcloud-server-27fcdb3af5d1b1012695a09e04c0a654a1dde710.tar.gz nextcloud-server-27fcdb3af5d1b1012695a09e04c0a654a1dde710.zip |
Merge branch 'master' into files_encryption_upgrade_fix
Conflicts:
apps/files_encryption/tests/crypt.php
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r-- | apps/files_external/lib/smb.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 655c3c9a816..81a6c956385 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -57,12 +57,22 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ public function stat($path) { if ( ! $path and $this->root=='/') {//mtime doesn't work for shares - $mtime=$this->shareMTime(); $stat=stat($this->constructUrl($path)); + if (empty($stat)) { + return false; + } + $mtime=$this->shareMTime(); $stat['mtime']=$mtime; return $stat; } else { - return stat($this->constructUrl($path)); + $stat = stat($this->constructUrl($path)); + + // smb4php can return an empty array if the connection could not be established + if (empty($stat)) { + return false; + } + + return $stat; } } |