Browse Source

see #5057 Dropbox: unable to download files

Laurent Opprecht 12 years ago
parent
commit
2e4fffaccb
1 changed files with 12 additions and 6 deletions
  1. 12 6
      main/dropbox/dropbox_functions.inc.php

+ 12 - 6
main/dropbox/dropbox_functions.inc.php

@@ -37,12 +37,18 @@ function handle_multiple_actions() {
 	}
 
 	// STEP 2: at least one file has to be selected. If not we return an error message
-	foreach ($_POST as $key => $value) {
-		if (strstr($value, $part.'_') AND $key != 'view_received_category' AND $key != 'view_sent_category') {
-			$checked_files = true;
-			$checked_file_ids[] = intval(substr($value, strrpos($value, '_')));
-		}
-	}
+    $ids = Request::get('id', array());
+    if(count($ids)>0){        
+        $checked_file_ids = $_POST['id'];
+    }
+    else{      
+        foreach ($_POST as $key => $value) {
+            if (strstr($value, $part.'_') AND $key != 'view_received_category' AND $key != 'view_sent_category') {
+                $checked_files = true;
+                $checked_file_ids[] = intval(substr($value, strrpos($value, '_')));
+            }
+        }
+    }
 	$checked_file_ids = $_POST['id'];
 
 	if (!is_array($checked_file_ids) || count($checked_file_ids) == 0) {