mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-04-08 22:37:23 +02:00
Do not allow decimal points in quota sizes
This commit is contained in:
@@ -433,9 +433,9 @@ def validate_quota(quota):
|
||||
|
||||
if quota == "":
|
||||
raise ValueError("No quota provided.")
|
||||
if re.search(r"[\s,]", quota):
|
||||
raise ValueError("Quotas cannot contain spaces or commas.")
|
||||
if not re.match(r'^[\d\.]+[GM]?$', quota):
|
||||
if re.search(r"[\s,.]", quota):
|
||||
raise ValueError("Quotas cannot contain spaces, commas, or decimal points.")
|
||||
if not re.match(r'^[\d]+[GM]?$', quota):
|
||||
raise ValueError("Invalid quota.")
|
||||
|
||||
return quota
|
||||
|
||||
Reference in New Issue
Block a user