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.

import: Sanitize realm icon filenames from imports.

Alex Vandiver6bdcf0af0309
diff --git a/zerver/lib/import_realm.py b/zerver/lib/import_realm.py
index e50ff2a962f..bc6b8ec5281 100644
--- a/zerver/lib/import_realm.py
+++ b/zerver/lib/import_realm.py
@@ -1186,7 +1186,7 @@ def import_uploads(
relative_path += ".original"
sanitized_record.raw_record["last_modified"] = timestamp
elif processing_realm_icons:
- icon_name = os.path.basename(sanitized_record.original_relative_path)
+ icon_name = sanitize_name(os.path.basename(sanitized_record.original_relative_path))
relative_path = os.path.join(
str(sanitized_record.raw_record["realm_id"]), "realm", icon_name
)