From 6656b042b86e6f8a102bb96d612a7218eeb96031 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma <32020192+tds-1@users.noreply.github.com> Date: Thu, 3 Jul 2025 00:09:27 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 105: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../dashboard/components-next/fileUpload/FileUpload.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components-next/fileUpload/FileUpload.vue b/app/javascript/dashboard/components-next/fileUpload/FileUpload.vue index 33765e395..bd403c293 100644 --- a/app/javascript/dashboard/components-next/fileUpload/FileUpload.vue +++ b/app/javascript/dashboard/components-next/fileUpload/FileUpload.vue @@ -59,7 +59,7 @@ const validateFile = file => { // Check file type if specified if ( props.accept !== '*' && - !file.type.match(new RegExp(props.accept.replace('*', '.*'))) + !file.type.match(new RegExp(props.accept.replace(/\*/g, '.*'))) ) { const errorMsg = `File type not supported. Only ${props.accept} files are allowed.`; emit('file-error', errorMsg);