mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-08-20 15:44:13 -05:00
chore: update body regex
This commit is contained in:
@@ -107,7 +107,7 @@ PostSchema.method<HydratedPostDocument>('generatePostUID', async function genera
|
||||
});
|
||||
|
||||
PostSchema.method<HydratedPostDocument>('cleanedBody', function cleanedBody(): string {
|
||||
return this.body ? this.body.replace(/[\p{L}\p{P}\d$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/g, '').replace(/[\n\r]+/gm, '') : '';
|
||||
return this.body ? this.body.replace(/[^\p{L}\p{P}\d\n\r~$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/gu, '').replace(/[\n\r]+/gm, '') : '';
|
||||
});
|
||||
|
||||
PostSchema.method<HydratedPostDocument>('cleanedMiiData', function cleanedMiiData(): string {
|
||||
|
||||
@@ -160,7 +160,7 @@ router.post('/', upload.none(), async function (request: express.Request, respon
|
||||
}
|
||||
|
||||
if (messageBody) {
|
||||
messageBody = messageBody.replace(/[\p{L}\p{P}\d$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/g, '');
|
||||
messageBody = messageBody.replace(/[^\p{L}\p{P}\d\n\r~$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/gu, '');
|
||||
}
|
||||
|
||||
if (messageBody.length > 280) {
|
||||
|
||||
@@ -318,7 +318,7 @@ async function newPost(request: express.Request, response: express.Response): Pr
|
||||
}
|
||||
|
||||
if (messageBody) {
|
||||
messageBody = messageBody.replace(/[\p{L}\p{P}\d$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/g, '');
|
||||
messageBody = messageBody.replace(/[^\p{L}\p{P}\d\n\r~$^¨←→↑↓√¦⇒⇔¤¢€£¥™©®+×÷=±∞˘˙¸˛˜°¹²³♭♪¬¯¼½¾♡♥●◆■▲▼☆★♀♂<>]/gu, '');
|
||||
}
|
||||
|
||||
if (messageBody && messageBody.length > 280) {
|
||||
|
||||
Reference in New Issue
Block a user