Disallow printer names that start with a dot

Fixes #8639.
This commit is contained in:
Ghostkeeper 2020-10-30 11:10:30 +01:00
parent f63df7f8c4
commit 31ee864f04
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -31,7 +31,7 @@ class MachineNameValidator(QObject):
# special character, and that up to [machine_name_max_length / 12] times.
maximum_special_characters = int(machine_name_max_length / 12)
unescaped = r"[a-zA-Z0-9_\-\.\/]"
self.machine_name_regex = r"^((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}$"
self.machine_name_regex = r"^[^\.]((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}$"
validationChanged = pyqtSignal()