From b2440586d620f94b6eef16ce8f0dd43810506572 Mon Sep 17 00:00:00 2001 From: Dimitar Yanakiev Date: Fri, 28 Feb 2025 20:49:33 +0200 Subject: [PATCH] fix: Fix regex in File Manager to support hyphenated usernames and groups (#516) --- app/Models/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/File.php b/app/Models/File.php index 7948d4d..31c6c37 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -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',