From 295af1f43e524eab1ff91a80f1f415141f1e6ae4 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 1 Dec 2019 11:49:14 +0100 Subject: [PATCH] adding file length limit to tar export --- src/services/export/tar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/export/tar.js b/src/services/export/tar.js index 441f62d9d..7af704f2d 100644 --- a/src/services/export/tar.js +++ b/src/services/export/tar.js @@ -84,7 +84,12 @@ async function exportToTar(taskContext, branch, format, res) { } const completeTitle = branch.prefix ? (branch.prefix + ' - ' + note.title) : note.title; - const baseFileName = sanitize(completeTitle); + let baseFileName = sanitize(completeTitle); + + if (baseFileName.length > 200) { // actual limit is 256 bytes(!) but let's be conservative + baseFileName = baseFileName.substr(0, 200); + } + const notePath = parentMeta.notePath.concat([note.noteId]); if (note.noteId in noteIdToMeta) {