05/06 Phase 2: updated and added new files

This commit is contained in:
2026-05-06 17:40:21 -04:00
parent d924e41d9e
commit 8da0c11290
28 changed files with 2113 additions and 35 deletions
+6
View File
@@ -98,3 +98,9 @@ def sanitise_string(value: str, max_length: int = None) -> str:
def validate_slug(slug: str) -> bool:
"""Return True if the slug matches the allowed pattern."""
return bool(_SLUG_RE.match(slug))
def validate_setting_key(key: str) -> bool:
"""Return True if key is a valid setting key (alphanumeric, underscores, dots)."""
import re
return bool(key and re.match(r'^[a-zA-Z0-9_.]+$', key) and len(key) <= 100)