From ec4feaee8b291cf65cd479d0b87122cdc27b7e6a Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 24 Jul 2025 18:07:34 +0200 Subject: [PATCH] protect against tom beech --- core/views/survex.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/views/survex.py b/core/views/survex.py index e9593ae..2a38ad7 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -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"