summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2013-06-02 14:04:55 -0700
committerFrank Karlitschek <frank@owncloud.org>2013-06-02 14:04:55 -0700
commit9392d2d58ebfcc9f719dd9777578ab9493ffa488 (patch)
tree7c80e3e5cb7a28646a86ee54e95b857618156101
parentcf71a54f5d6e08020a1a574d43f7fca6642776c9 (diff)
parent1d7d5d289401ad40e1a74737416193ae856a15bc (diff)
downloadnextcloud-server-9392d2d58ebfcc9f719dd9777578ab9493ffa488.tar.gz
nextcloud-server-9392d2d58ebfcc9f719dd9777578ab9493ffa488.zip
Merge pull request #3567 from owncloud/fixing-3466
In cases where smb4php returns false of an empty array stat/( has to ret...
-rw-r--r--apps/files_external/lib/smb.php14
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;
}
}