2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 18:47:18 +00:00

protect against tom beech

This commit is contained in:
2025-07-24 18:07:34 +02:00
parent 6a6ec66a88
commit ec4feaee8b

View File

@@ -239,6 +239,9 @@ class SvxForm(forms.Form):
# this is a new survex file being created from the template
if not fname.parent.is_dir():
fname.parent.mkdir(parents=True, exist_ok=True)
if " " in self.data["filename"]:
errmsg = "Error: Spaces are not possible in filenames.\n\nRename the file."
return errmsg
if re.search(r"\[|\]", rcode):
errmsg = "Error: remove all []s from the text.\nEverything inside [] are only template guidance.\n\n"
errmsg += "All [] must be edited out and replaced with real data before you can save this file.\n"