Correct regex with non-wildcard, always check name
This commit is contained in:
parent
7448cd90da
commit
5b8f62a16c
@ -216,7 +216,7 @@ def ssh_public_keys():
|
||||
name = parts[0]
|
||||
else:
|
||||
errors.append("Name is required")
|
||||
elif not re.match(r"^[0-9A-Za-z_@. -]+$", name):
|
||||
if not re.match(r"^[0-9A-Za-z_@\. -]+$", name):
|
||||
errors.append("Name must match \"^[0-9A-Za-z_@. -]+$\"")
|
||||
|
||||
if method == "POST":
|
||||
@ -225,7 +225,7 @@ def ssh_public_keys():
|
||||
errors.append("Content is required")
|
||||
else:
|
||||
content = content.replace("\r", "").replace("\n", "")
|
||||
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", content):
|
||||
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@\. -]+$", content):
|
||||
errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$\"")
|
||||
|
||||
if get_model().ssh_public_key_name_exists(session["account"], name):
|
||||
|
Loading…
Reference in New Issue
Block a user