From 1f1826bf7a8b2a97956d001677ce0ecf917df047 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 27 Oct 2019 20:31:03 +0100 Subject: [PATCH] Possible fix for issue #2220 --- .../Server/webroot/ngax/scripts/services/AppUtils.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js b/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js index e6ac393fe..728d1456a 100644 --- a/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js +++ b/Duplicati/Server/webroot/ngax/scripts/services/AppUtils.js @@ -131,8 +131,8 @@ backupApp.service('AppUtils', function($rootScope, $timeout, $cookies, DialogSer name: gettextCatalog.getString('Exclude files whose names contain'), key: '-file*', prefix: '-[.*', - suffix: '.*[^!]]', - rx: '\\-\\[\\.\\*([^\\!]+)\\.\\*\\[\\^\\!\\]\\]' + suffix: '[^!]*]', + rx: '\\-\\[\\.\\*[\\^\\!\\]\\*\\]' }, { name: gettextCatalog.getString('Exclude folder'), key: '-folder', @@ -545,6 +545,10 @@ backupApp.service('AppUtils', function($rootScope, $timeout, $cookies, DialogSer } function matches(txt, n) { + // We need to escape dirsep if it is the backslash character + if (dirsep == '\\') + dirsep = '\\\\'; + var pre = apputils.replace_all(n.prefix || '', '!', dirsep); var suf = apputils.replace_all(n.suffix || '', '!', dirsep); @@ -583,6 +587,10 @@ backupApp.service('AppUtils', function($rootScope, $timeout, $cookies, DialogSer body = body || ''; + // We need to escape dirsep if it is the backslash character + if (dirsep == '\\') + dirsep = '\\\\'; + var f = this.filterTypeMap[type]; var pre = this.replace_all(f.prefix || '', '!', dirsep); var suf = this.replace_all(f.suffix || '', '!', dirsep);