From 2703077d1bf1df08fddfb641af028f8826afbd51 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:43:57 +0200 Subject: [PATCH] improve redirect --- frontend/src/lib/utils/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/utils/helpers.ts b/frontend/src/lib/utils/helpers.ts index 367b679f1..e40ce9e98 100644 --- a/frontend/src/lib/utils/helpers.ts +++ b/frontend/src/lib/utils/helpers.ts @@ -60,7 +60,7 @@ export function formatScoreValue(value: number, max_score: number, fullDonut = f } export function getSecureRedirect(url: any): string { - const SECURE_REDIRECT_URL_REGEX = /^\/(?!.*\/\/)[^\s]*$/; + const SECURE_REDIRECT_URL_REGEX = /^\/[^/]/; return typeof url === 'string' && SECURE_REDIRECT_URL_REGEX.test(url) ? url : ''; }