fix: closes #10621, convert \r\n to \n so it isn't counted as 2 characters

isekai-main
Barış Soner Uşaklı 3 years ago
parent 1dc9671749
commit 3a009f96cd

@ -165,7 +165,8 @@ module.exports = function (User) {
if (!data.signature) {
return;
}
if (data.signature !== undefined && data.signature.length > meta.config.maximumSignatureLength) {
const signature = data.signature.replace(/\r\n/g, '\n');
if (signature.length > meta.config.maximumSignatureLength) {
throw new Error(`[[error:signature-too-long, ${meta.config.maximumSignatureLength}]]`);
}
await User.checkMinReputation(callerUid, data.uid, 'min:rep:signature');

Loading…
Cancel
Save