Merge pull request #3567 from owncloud/fixing-3466

In cases where smb4php returns false of an empty array stat/( has to ret...
This commit is contained in:
Frank Karlitschek 2013-06-02 14:04:55 -07:00
commit 9392d2d58e
1 changed files with 12 additions and 2 deletions

View File

@ -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;
}
}