mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 17:34:32 +02:00
Fixed some more inspection issues
This commit is contained in:
parent
de96aae9a5
commit
29d1d49aca
83 changed files with 153 additions and 172 deletions
|
@ -443,11 +443,13 @@ class AttachmentSubmitHandler
|
|||
];
|
||||
if (ctype_digit((string) $maxSize)) {
|
||||
return (int) $maxSize;
|
||||
} elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) {
|
||||
return (((int) $matches[1]) * $factors[strtolower($matches[2])]);
|
||||
} else {
|
||||
throw new RuntimeException(sprintf('"%s" is not a valid maximum size.', $maxSize));
|
||||
}
|
||||
|
||||
if (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) {
|
||||
return (((int) $matches[1]) * $factors[strtolower($matches[2])]);
|
||||
}
|
||||
|
||||
throw new RuntimeException(sprintf('"%s" is not a valid maximum size.', $maxSize));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue