mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-04-12 07:37:34 +02:00
Clean filename before presenting it to error modal
This commit is contained in:
@@ -224,7 +224,7 @@ export default class FilesField {
|
||||
file,
|
||||
data: response,
|
||||
mode: 'removeFile',
|
||||
msg: `<p>${translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD} <strong>${file.name}</strong></p>
|
||||
msg: `<p>${translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD} <strong>{{fileName}}</strong></p>
|
||||
<pre>${response.message}</pre>`
|
||||
});
|
||||
}
|
||||
@@ -240,7 +240,7 @@ export default class FilesField {
|
||||
file,
|
||||
data,
|
||||
mode: 'removeFile',
|
||||
msg: `<p>${translations.PLUGIN_ADMIN.FILE_ERROR_ADD} <strong>${file.name}</strong></p>
|
||||
msg: `<p>${translations.PLUGIN_ADMIN.FILE_ERROR_ADD} <strong>{{fileName}}</strong></p>
|
||||
<pre>${data.message}</pre>`
|
||||
});
|
||||
}
|
||||
@@ -325,7 +325,9 @@ export default class FilesField {
|
||||
}
|
||||
|
||||
let modal = $('[data-remodal-id="generic"]');
|
||||
modal.find('.error-content').html(msg);
|
||||
const cleanName = file.name.replace('<', '<').replace('>', '>');
|
||||
|
||||
modal.find('.error-content').html(msg.replace('{{fileName}}', cleanName));
|
||||
$.remodal.lookup[modal.data('remodal')].open();
|
||||
}
|
||||
}
|
||||
|
||||
15991
themes/grav/js/admin.min.js
vendored
15991
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
96211
themes/grav/js/vendor.min.js
vendored
96211
themes/grav/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user