fix length validation
This commit is contained in:
parent
063b2ff266
commit
3842a1ee8c
4 changed files with 29 additions and 2 deletions
|
|
@ -371,6 +371,18 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
data.text = null;
|
||||
}
|
||||
|
||||
if (data.cw) {
|
||||
if (data.cw.length > DB_MAX_NOTE_TEXT_LENGTH) {
|
||||
data.cw = data.cw.slice(0, DB_MAX_NOTE_TEXT_LENGTH);
|
||||
}
|
||||
data.cw = data.cw.trim();
|
||||
if (data.cw === '') {
|
||||
data.cw = null;
|
||||
}
|
||||
} else {
|
||||
data.cw = null;
|
||||
}
|
||||
|
||||
let tags = data.apHashtags;
|
||||
let emojis = data.apEmojis;
|
||||
let mentionedUsers = data.apMentions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue