mirror of https://github.com/zulip/zulip.git
06dd6f8254
Removes the initial check in `_internal_prep_message` of the length of the message content because the `check_message` in the try block will call `normalize_body` on the message content string, which does a more robust check of the message content (empty string, null bytes, length). If the message content length exceeds the value of `settings.MAX_MESSAGE_LENGTH`, then it is truncated based on that value. Updates associated backend test for these changes. The removed length check would truncate the message content with a hard coded value instead of using the value for `settings.MAX_MESSAGE_LENGTH`. Also, removes an extraneous comment about removing null bytes. If there are null bytes in the message content, then `normalize_body` will raise an error. Note that the previous check had intentionally reduced any message over the 10000 character limit to 3900 characters, with the code in question dating to 2012's |
||
---|---|---|
.. | ||
actions | ||
data_import | ||
integration_fixtures/nagios | ||
lib | ||
management | ||
migrations | ||
openapi | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |