fix: Fix regex in File Manager to support hyphenated usernames and groups (#516)

This commit is contained in:
Dimitar Yanakiev 2025-02-28 20:49:33 +02:00 committed by GitHub
parent 4b8e798e66
commit b2440586d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,7 @@ public static function parse(User $user, Server $server, string $path, string $s
array_shift($lines);
foreach ($lines as $line) {
if (preg_match('/^([drwx\-]+)\s+(\d+)\s+(\w+)\s+(\w+)\s+(\d+)\s+([\w\s:\-]+)\s+(.+)$/', $line, $matches)) {
if (preg_match('/^([drwx\-]+)\s+(\d+)\s+([\w\-]+)\s+([\w\-]+)\s+(\d+)\s+([\w\s:\-]+)\s+(.+)$/', $line, $matches)) {
$type = match ($matches[1][0]) {
'-' => 'file',
'd' => 'directory',