2 Commits

Author SHA1 Message Date
Eva
a34147542a Merge 50c003f80b into ee7e9ef2a3 2025-05-23 20:32:19 +02:00
Eva
50c003f80b server/tags: prevent creation of "." and ".." tags
cf. #521
Previously this check was only done on the client. The API operates on
tag slugs, and these special strings cause issues with web servers.
2025-03-27 14:50:56 +01:00

View File

@ -42,6 +42,8 @@ def _verify_name_validity(name: str) -> None:
name_regex = config.config["tag_name_regex"]
if not re.match(name_regex, name):
raise InvalidTagNameError("Name must satisfy regex %r." % name_regex)
if name in [".", ".."]:
raise InvalidTagNameError(f"Tag `{name}` is not allowed.")
def _get_names(tag: model.Tag) -> List[str]: