We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68ea283 commit 4ef8e46Copy full SHA for 4ef8e46
1 file changed
Mailman/Utils.py
@@ -1735,3 +1735,17 @@ def validate_ip_address(ip):
1735
pass
1736
1737
return False, None
1738
+
1739
+def ValidateListName(listname):
1740
+ """Validate a list name against the acceptable character pattern.
1741
1742
+ Args:
1743
+ listname: The list name to validate
1744
1745
+ Returns:
1746
+ bool: True if the list name is valid, False otherwise
1747
+ """
1748
+ if not listname:
1749
+ return False
1750
+ # Check if the list name contains any characters not in the acceptable pattern
1751
+ return len(re.sub(mm_cfg.ACCEPTABLE_LISTNAME_CHARACTERS, '', listname)) == 0
0 commit comments