From 7859b8539193c7ddbfe97866fc63562ec23cb819 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Fri, 3 May 2019 13:18:41 -0700 Subject: [PATCH] Use numbered capture over named capture (#2765) --- app/utils/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/file.js b/app/utils/file.js index 586571908..6ff4a37a9 100644 --- a/app/utils/file.js +++ b/app/utils/file.js @@ -10,7 +10,7 @@ import {lookupMimeType} from 'mattermost-redux/utils/file_utils'; import {DeviceTypes} from 'app/constants/'; const EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; -const CONTENT_DISPOSITION_REGEXP = /inline;filename=".*\.(?[a-z]+)";/i; +const CONTENT_DISPOSITION_REGEXP = /inline;filename=".*\.([a-z]+)";/i; const {DOCUMENTS_PATH, IMAGES_PATH, VIDEOS_PATH} = DeviceTypes; const DEFAULT_SERVER_MAX_FILE_SIZE = 50 * 1024 * 1024;// 50 Mb @@ -238,7 +238,7 @@ export function getLocalFilePathFromFile(dir, file) { export function getExtensionFromContentDisposition(contentDisposition) { const match = CONTENT_DISPOSITION_REGEXP.exec(contentDisposition); - let extension = match && match.groups.ext; + let extension = match && match[1]; if (extension) { if (!Object.keys(types).length) { populateMaps();