Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upload: Mention new difference between sanitize_name and slugify.

Mateusz Mandera6a8586e9891d
diff --git a/zerver/lib/upload.py b/zerver/lib/upload.py
index c4756d43f9e..6c2a3030fc2 100644
--- a/zerver/lib/upload.py
+++ b/zerver/lib/upload.py
@@ -89,6 +89,7 @@ def sanitize_name(value: str) -> str:
modified by:
* adding '.' to the list of allowed characters.
* preserving the case of the value.
+ * not stripping trailing dashes and underscores.
"""
value = unicodedata.normalize("NFKC", value)
value = re.sub(r"[^\w\s.-]", "", value, flags=re.U).strip()