diff options
author | Robin Appelman <robin@icewind.nl> | 2018-08-22 15:16:33 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-08-22 15:16:33 +0300 |
commit | c1389070fad5c84158d46ca784ba5e63af88d283 (patch) | |
tree | 42f690217bd56d8d65bcec83a8636b4d1d595bc7 /apps/files_external/3rdparty | |
parent | de119eefd66a3bce10909f16ac2c5b6527029682 (diff) |
use dir instead of allinfo where possible
Diffstat (limited to 'apps/files_external/3rdparty')
-rw-r--r-- | apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php index ca88af219a8..ce1c4b85778 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php @@ -153,6 +153,18 @@ class Share extends AbstractShare { * @return \Icewind\SMB\IFileInfo */ public function stat($path) { + // some windows server setups don't seem to like the allinfo command + // use the dir command instead to get the file info where possible + if ($path !== "" && $path !== "/") { + $parent = dirname($path); + $dir = $this->dir($parent); + $file = array_values(array_filter($dir, function(IFileInfo $info) use ($path) { + return $info->getPath() === $path; + })); + if ($file) { + return $file[0]; + } + } $escapedPath = $this->escapePath($path); $output = $this->execute('allinfo ' . $escapedPath); // Windows and non Windows Fileserver may respond different |