mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
handle lowercase modes
This commit is contained in:
parent
f8cbc6081b
commit
49b1e989fe
1 changed files with 2 additions and 2 deletions
|
|
@ -172,14 +172,14 @@ class Parser {
|
|||
public function parseDir(array $output, string $basePath, callable $aclCallback): array {
|
||||
//last line is used space
|
||||
array_pop($output);
|
||||
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARS]*)\s+)?([0-9]+)\s+(.*)$/';
|
||||
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARSCndharsc]*)\s+)?([0-9]+)\s+(.*)$/';
|
||||
//2 spaces, filename, optional type, size, date
|
||||
$content = [];
|
||||
foreach ($output as $line) {
|
||||
if (preg_match($regex, $line, $matches)) {
|
||||
list(, $name, $mode, $size, $time) = $matches;
|
||||
if ($name !== '.' and $name !== '..') {
|
||||
$mode = $this->parseMode($mode);
|
||||
$mode = $this->parseMode(strtoupper($mode));
|
||||
$time = strtotime($time . ' ' . $this->timeZone);
|
||||
$path = $basePath . '/' . $name;
|
||||
$content[] = new FileInfo($path, $name, (int)$size, $time, $mode, function () use ($aclCallback, $path): array {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue