discourse/db
Andrei Prigorshnev 00300b118d
FIX: errors that're triggering by too long excerpts (#13056)
The excerpt field in the database is constrained to 1000 chars in length. To support this constraint we added a restriction that the topic_excerpt_maxlength setting must be between 0 and 999.

Unfortunately, sometimes it doesn’t work because:

- topic_excerpt_maxlength restricts the length of a visible to user excerpt. But we HTML-escape text before saving. If an excerpt contains & it’ll be &. One character for the user but 5 characters to save to the database. So if topic_excerpt_maxlength is set to 999 it’s not so hard to have an excerpt of for example 1003 characters in length and run into this issue.
- It’s possible to define a custom excerpt for a topic. Such excerpts bypass check for a length. So if the user defines a too long custom excerpt he will run into this issue.

Removing the constraint on the database level solves the problem. But we still need the constraint for topic_excerpt_maxlength on the setting page, because too long excerpts would make UI wonky.
2021-05-31 14:59:40 +04:00
..
fixtures DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
migrate FEATURE: Improve group email settings UI (#13083) 2021-05-28 09:28:18 +10:00
post_migrate FIX: errors that're triggering by too long excerpts (#13056) 2021-05-31 14:59:40 +04:00
api_test_seeds.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00