Fix page media nonce on post actions

This commit is contained in:
Flavio Copes
2015-11-19 22:43:14 +01:00
parent 1218a0aed0
commit 5039d8fd0b

View File

@@ -109,7 +109,7 @@
this.on('removedfile', function(file) {
if (!file.accepted || file.rejected) return;
thisDropzone = this;
$.post(URI + '/task{{ config.system.param_sep }}delmedia', {filename: file.name}, function(data){
$.post(URI + '/task{{ config.system.param_sep }}delmedia', {filename: file.name, 'admin-nonce': $('#admin-nonce').val()}, function(data){
$.proxy(modalError, thisDropzone, {
file: file,
data: data,
@@ -118,6 +118,10 @@
})();
});
});
this.on('sending', function(file, xhr, formData){
formData.append('admin-nonce', $('#admin-nonce').val());
});
}
};