From 352ab6acf0c09fb160fd1ab0bc1b34ee2e9d16a0 Mon Sep 17 00:00:00 2001 From: "Xavier.Meng" Date: Wed, 15 Feb 2023 15:27:29 +0800 Subject: [PATCH] =?UTF-8?q?BI-121538=20fix(bi.file):=20=E4=B8=A5=E6=A0=BC?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/input/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 290970141..1769de9c5 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -437,11 +437,11 @@ var matches; matches = mime.match(r1); if (matches) { - return fileName.toLowerCase().indexOf(matches[1]) > -1; + return fileName.toLowerCase().endsWith(matches[0]); } matches = mime.match(r2); if (matches) { - return matches[1] === "*" ? true : fileName.toLowerCase().indexOf(matches[1]) > -1; + return matches[1] === "*" ? true : fileName.toLowerCase().endsWith(`.${matches[1]}`); } }); }