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.

thumbnail: Fix MAX_EMOJI_GIF_FILE_SIZE_BYTES check to be post-resize.

Alex Vandiver262689da7645
diff --git a/zerver/lib/upload/__init__.py b/zerver/lib/upload/__init__.py
index 186424474be..90d185019ea 100644
--- a/zerver/lib/upload/__init__.py
+++ b/zerver/lib/upload/__init__.py
@@ -361,7 +361,7 @@ def upload_emoji_image(
if still_image_data is not None:
if len(still_image_data) > MAX_EMOJI_GIF_FILE_SIZE_BYTES: # nocoverage
raise BadImageError(_("Image size exceeds limit"))
- elif len(image_data) > MAX_EMOJI_GIF_FILE_SIZE_BYTES: # nocoverage
+ elif len(resized_image_data) > MAX_EMOJI_GIF_FILE_SIZE_BYTES: # nocoverage
raise BadImageError(_("Image size exceeds limit"))
backend.upload_single_emoji_image(emoji_path, content_type, user_profile, resized_image_data)
if still_image_data is None: