Skip to content

Commit

Permalink
Dev: Fixed issue : Download dir/files via KCFinder
Browse files Browse the repository at this point in the history
Dev: CRSF token active
  • Loading branch information
Shnoulle committed Jun 17, 2015
1 parent d77319c commit ee717f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/kcfinder/js/091.menus.js
Expand Up @@ -251,7 +251,7 @@ _.menuFile = function(file, e) {

// DOWNLOAD
_.menu.addItem("kcact:download", _.label("Download"), function() {
$('#menu').html('<form id="downloadForm" method="post" action="' + _.getURL('download') + '"><input type="hidden" name="dir" /><input type="hidden" name="file" /></form>');
$('#menu').html('<form id="downloadForm" method="post" action="' + _.getURL('download') + '"><input type="hidden" name="dir" /><input type="hidden" name="file" /><input type="hidden" name="kcfinder_csrftoken" value="' + _.csrftoken + '" /></form>');
$('#downloadForm input').get(0).value = _.dir;
$('#downloadForm input').get(1).value = data.name;
$('#downloadForm').submit();
Expand Down Expand Up @@ -586,4 +586,4 @@ _.openClipboard = function() {
}).width(dlg.width() + _.scrollbarWidth);
}
}, 1);
};
};
3 changes: 3 additions & 0 deletions third_party/kcfinder/js/120.misc.js
Expand Up @@ -117,6 +117,9 @@ _.post = function(url, data) {
else
html += '<input type="hidden" name="' + $.$.htmlValue(key) + '" value="' + $.$.htmlValue(val) + '" />';
});
if(typeof _.csrftoken!="undefined")
html += '<input type="hidden" name="kcfinder_csrftoken" value="' + _.csrftoken + '" />';

html += '</form>';
$('#menu').html(html).show();
$('#postForm').get(0).submit();
Expand Down

0 comments on commit ee717f9

Please sign in to comment.