mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-05 12:46:47 +02:00
Fix #833 issue with files with accented chars
This commit is contained in:
@@ -166,6 +166,11 @@ export default class FilesField {
|
||||
}
|
||||
}
|
||||
|
||||
b64_to_utf8(str) {
|
||||
str = str.replace(/\s/g, '');
|
||||
return decodeURIComponent(escape(window.atob(str)));
|
||||
}
|
||||
|
||||
onDropzoneRemovedFile(file, ...extra) {
|
||||
if (!file.accepted || file.rejected) { return; }
|
||||
let url = file.removeUrl || this.urls.delete;
|
||||
@@ -180,7 +185,7 @@ export default class FilesField {
|
||||
request(url, { method: 'post', body }, () => {
|
||||
if (!path) { return; }
|
||||
|
||||
path = global.atob(path[1]);
|
||||
path = this.b64_to_utf8(path[1]);
|
||||
let input = this.container.find('[name][type="hidden"]');
|
||||
let data = JSON.parse(input.val() || '{}');
|
||||
delete data[path];
|
||||
|
||||
18
themes/grav/js/admin.min.js
vendored
18
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user