From 86286c6fce60eb88e8f701a9b19b2705bfee073e Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 9 Jul 2019 12:22:52 +0100 Subject: [PATCH] Don't generate filenames starting with a period --- core/modules/utils/filesystem.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js index 0bf41fb47..999239450 100644 --- a/core/modules/utils/filesystem.js +++ b/core/modules/utils/filesystem.js @@ -266,6 +266,8 @@ exports.generateTiddlerFilepath = function(title,options) { // Remove any forward or backward slashes so we don't create directories filepath = filepath.replace(/\/|\\/g,"_"); } + // Don't let the filename start with a dot because such files are invisible on *nix + filepath = filepath.replace(/^\./g,"_"); // Remove any characters that can't be used in cross-platform filenames filepath = $tw.utils.transliterate(filepath.replace(/<|>|\:|\"|\||\?|\*|\^/g,"_")); // Truncate the filename if it is too long