From e0714405a3b0cb34fd8236665a99f9e58164d8ad Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 15 May 2018 14:00:38 +0200 Subject: [PATCH] Drop invisible characters from downloads filename. --- toolkit/content/contentAreaUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index 2b7af30dec..736fb7dfc5 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -1108,6 +1108,7 @@ function getDefaultFileName(aDefaultFileName, aURI, aDocument, function validateFileName(aFileName) { + aFileName = aFileName.replace(/[\u200e\u200f\u202a-\u202e]/g, ""); var re = /[\/]+/g; if (navigator.appVersion.indexOf("Windows") != -1) { re = /[\\\/\|]+/g;