Skip to content
Snippets Groups Projects
Verified Commit 9160ede4 authored by bunnybeam's avatar bunnybeam
Browse files

replace RE2 with RegExp for regex word mute validation

parent d14f0b14
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import RE2 from 're2';
import * as mfm from '@transfem-org/sfm-js';
import { Inject, Injectable } from '@nestjs/common';
import ms from 'ms';
......@@ -325,7 +324,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (!regexp) throw new ApiError(meta.errors.invalidRegexp);
try {
new RE2(regexp[1], regexp[2]);
new RegExp(regexp[1], regexp[2]);
} catch (err) {
throw new ApiError(meta.errors.invalidRegexp);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment