From 3c451cf88f5bbdfe8459f61bb8167872e32e2297 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 21:14:22 +0100 Subject: [Glitch] Fix useless regular-expression character escape detected by CodeQL --- app/javascript/flavours/glitch/utils/hashtag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/utils/hashtag.js b/app/javascript/flavours/glitch/utils/hashtag.js index 2024a665c..8f5665c46 100644 --- a/app/javascript/flavours/glitch/utils/hashtag.js +++ b/app/javascript/flavours/glitch/utils/hashtag.js @@ -1,6 +1,6 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { - const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); + const re = new RegExp(`(?:^|[^\/)\w])#(${tag.name})`, 'i'); const matched_hashtag = text.match(re); return matched_hashtag ? matched_hashtag[1] : null; }, -- cgit