diff options
author | Dean Ferreyra <dean@octw.com> | 2020-08-31 01:52:53 +0300 |
---|---|---|
committer | Dean Ferreyra <dean@octw.com> | 2020-08-31 03:07:04 +0300 |
commit | 5f94cc19a74a5c372dece9e1b656404bf43ab57d (patch) | |
tree | 7c0adf964645bb1ebf8e3f8835027cb3f394d6f1 /Duplicati/Server | |
parent | 40597aaec20bf319d4c02988a9748d81a452ef78 (diff) |
Fix restore GUI handling of folders with * or ?
Add new filter syntax, prefixing with an "at sign"; i.e., `@...`, that
disables glob expansion, treating `*` and `?` wildcard characters as
literal characters.
In the GUI, change the restore file picker to prefix paths with `@`
when expanding a node to avoid mistaking literal `*` or `?` characters
for wildcards characters and triggering the following error:
```
Filter for list-folder-contents must be a path prefix with no wildcards Parameter name: filter
```
This fixes #4300.
Diffstat (limited to 'Duplicati/Server')
-rw-r--r-- | Duplicati/Server/webroot/ngax/scripts/directives/restoreFilePicker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/directives/restoreFilePicker.js b/Duplicati/Server/webroot/ngax/scripts/directives/restoreFilePicker.js index ef142f6bc..3e71e8648 100644 --- a/Duplicati/Server/webroot/ngax/scripts/directives/restoreFilePicker.js +++ b/Duplicati/Server/webroot/ngax/scripts/directives/restoreFilePicker.js @@ -35,7 +35,10 @@ backupApp.directive('restoreFilePicker', function() { if (!node.children && !node.loading) { node.loading = true; - AppService.get('/backup/' + $scope.ngBackupId + '/files/' + encodeURIComponent(node.id) + '?prefix-only=false&folder-contents=true&time=' + encodeURIComponent($scope.ngTimestamp) + '&filter=' + encodeURIComponent(node.id)).then(function(data) { + // Prefix filter with "@" to prevent Duplicati from + // mistaking literal '*' and '?' characters in paths + // for glob wildcard characters + AppService.get('/backup/' + $scope.ngBackupId + '/files/' + encodeURIComponent(node.id) + '?prefix-only=false&folder-contents=true&time=' + encodeURIComponent($scope.ngTimestamp) + '&filter=' + encodeURIComponent('@' + node.id)).then(function(data) { var children = [] for(var n in data.data.Files) |