aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php')
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php
index 9eee686c0ba..a28432e4319 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php
@@ -33,7 +33,6 @@ class Parser {
*/
private $host;
- // todo replace with static once <5.6 support is dropped
// see error.h
const EXCEPTION_MAP = [
ErrorCodes::LogonFailure => AuthenticationException::class,
@@ -146,12 +145,12 @@ class Parser {
}
return [
'mtime' => strtotime($data['write_time']),
- 'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '('), -1)),
+ 'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '(') + 1, -1)),
'size' => isset($data['stream']) ? (int)(explode(' ', $data['stream'])[1]) : 0
];
}
- public function parseDir($output, $basePath) {
+ public function parseDir($output, $basePath, callable $aclCallback) {
//last line is used space
array_pop($output);
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARS]*)\s+)?([0-9]+)\s+(.*)$/';
@@ -163,7 +162,10 @@ class Parser {
if ($name !== '.' and $name !== '..') {
$mode = $this->parseMode($mode);
$time = strtotime($time . ' ' . $this->timeZone);
- $content[] = new FileInfo($basePath . '/' . $name, $name, $size, $time, $mode);
+ $path = $basePath . '/' . $name;
+ $content[] = new FileInfo($path, $name, $size, $time, $mode, function () use ($aclCallback, $path) {
+ return $aclCallback($path);
+ });
}
}
}