From 22cde183ff943fdb30a11cb20d856baaba81a0c5 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Tue, 19 Aug 2025 13:53:40 +0200 Subject: [PATCH] fix: Fix regex-based id validation when fetching user Closes #1302 --- server/api/controllers/users/show.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/controllers/users/show.js b/server/api/controllers/users/show.js index 2691cc39..b59c54c3 100755 --- a/server/api/controllers/users/show.js +++ b/server/api/controllers/users/show.js @@ -13,7 +13,7 @@ const Errors = { const CURRENT_USER_ID = 'me'; -const ID_OR_CURRENT_USER_ID_REGEX = new RegExp(`${ID_REGEX}|^${CURRENT_USER_ID}$`); +const ID_OR_CURRENT_USER_ID_REGEX = new RegExp(`${ID_REGEX.source}|^${CURRENT_USER_ID}$`); const isCurrentUserIdOrIdInRange = (value) => value === CURRENT_USER_ID || isIdInRange(value);