From b33d1b0822e7c8cf43fdf6c002c525902be9ebd0 Mon Sep 17 00:00:00 2001 From: Ng Guoyou Date: Fri, 26 Jan 2018 10:40:53 +0800 Subject: [PATCH] Treat `~` as a normal character in paths (#51) --- CHANGELOG.md | 1 + src/download.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b31f7f..740ba8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Fix save-to-click toggle key not deactivating after switching tabs * Add more fields to Freedesktop shortcuts (#54) +* Treat `~` as a normal character in paths (#51) * Refactor options management backend # 2.3.0 diff --git a/src/download.js b/src/download.js index a13fd4b..e7d1996 100644 --- a/src/download.js +++ b/src/download.js @@ -2,7 +2,7 @@ const DISPOSITION_FILENAME_REGEX = /filename[^;=\n]*=((['"])(.*)?\2|(.+'')?([^;\n]*))/i; const EXTENSION_REGEX = /\.([0-9a-z]{1,8})$/i; -const SPECIAL_CHARACTERS_REGEX = /[~<>:"/\\|?*\0]/g; +const SPECIAL_CHARACTERS_REGEX = /[<>:"/\\|?*\0]/g; const BAD_LEADING_CHARACTERS = /^[./\\]/g; const SEPARATOR_REGEX = /[/\\]/g;