Use only exact lenghth matches

This commit is contained in:
DariusIII
2025-01-30 12:56:57 +01:00
parent c048899138
commit fbeff33529
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ class ReleaseFile extends Model
'updated_at' => now()->timestamp,
'passworded' => $hasPassword,
'crc32' => $crc,
'ishashed' => preg_match('/[a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}/i', $name) ? 1 : 0,
'ishashed' => preg_match('/^[a-fA-F0-9]{32}\b|^[a-fA-F0-9]{40}\b|^[a-fA-F0-9]{64}\b/i', $name) ? 1 : 0,
]);
} catch (\PDOException $e) {
Log::alert($e->getMessage());