Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 49b1e98

Browse files
committed
handle lowercase modes
1 parent f8cbc60 commit 49b1e98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Wrapped/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ public function parseStat(array $output): array {
172172
public function parseDir(array $output, string $basePath, callable $aclCallback): array {
173173
//last line is used space
174174
array_pop($output);
175-
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARS]*)\s+)?([0-9]+)\s+(.*)$/';
175+
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARSCndharsc]*)\s+)?([0-9]+)\s+(.*)$/';
176176
//2 spaces, filename, optional type, size, date
177177
$content = [];
178178
foreach ($output as $line) {
179179
if (preg_match($regex, $line, $matches)) {
180180
list(, $name, $mode, $size, $time) = $matches;
181181
if ($name !== '.' and $name !== '..') {
182-
$mode = $this->parseMode($mode);
182+
$mode = $this->parseMode(strtoupper($mode));
183183
$time = strtotime($time . ' ' . $this->timeZone);
184184
$path = $basePath . '/' . $name;
185185
$content[] = new FileInfo($path, $name, (int)$size, $time, $mode, function () use ($aclCallback, $path): array {

0 commit comments

Comments
 (0)