From 9160ede4d5482d70623dd64c47f13b61f7639fc0 Mon Sep 17 00:00:00 2001 From: bunnybeam Date: Sat, 21 Dec 2024 01:34:56 +0000 Subject: [PATCH] replace RE2 with RegExp for regex word mute validation --- packages/backend/src/server/api/endpoints/i/update.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index bb0f5aa11a..09c06a108d 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -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 { // 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); }