summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-29 16:43:50 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-29 16:43:50 +0100
commit71589e65d24657a6d61fc22b3c67d5a1f5b1404a (patch)
tree6ed29943a9b589b80841282d2a8a254c02ec033d /apps/files_trashbin
parent41a1a32e5ad19c041e22b20873e769ecfa6aa8c8 (diff)
downloadnextcloud-server-71589e65d24657a6d61fc22b3c67d5a1f5b1404a.tar.gz
nextcloud-server-71589e65d24657a6d61fc22b3c67d5a1f5b1404a.zip
fix restore from files in sub-folders
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/ajax/undelete.php1
-rw-r--r--apps/files_trashbin/js/trash.js4
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php
index e39004cc0d5..876ad269a70 100644
--- a/apps/files_trashbin/ajax/undelete.php
+++ b/apps/files_trashbin/ajax/undelete.php
@@ -13,6 +13,7 @@ $success = array();
$i = 0;
foreach ($list as $file) {
if ( $dirlisting === '0') {
+ $file = ltrim($file, '/');
$delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2);
diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js
index 84c23d66992..2c1af34ccec 100644
--- a/apps/files_trashbin/js/trash.js
+++ b/apps/files_trashbin/js/trash.js
@@ -8,7 +8,7 @@ $(document).ready(function() {
deleteAction.removeClass('delete-icon').addClass('progress-icon');
disableActions();
$.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'),
- {files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')},
+ {files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')},
function(result) {
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
@@ -229,7 +229,7 @@ function getSelectedFiles(property){
elements.each(function(i,element){
var file={
name:$(element).attr('data-filename'),
- file:$(element).attr('data-file'),
+ file:$('#dir').val() + "/" + $(element).attr('data-file'),
timestamp:$(element).attr('data-timestamp'),
type:$(element).attr('data-type'),
dirlisting:$(element).attr('data-dirlisting')