From db36286e1f650287bf3170befd7d74472ccf1e83 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 5 Mar 2014 11:48:27 -0500 Subject: [PATCH] Fix issue counting double document size if used in sessions --- main/document/document.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/document/document.php b/main/document/document.php index 34104e0b92..98c0b28777 100644 --- a/main/document/document.php +++ b/main/document/document.php @@ -1129,6 +1129,7 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) { $sortable_data = array(); $count = 1; + $countedPaths = array(); foreach ($docs_and_folders as $key => $document_data) { $row = array(); $row['id'] = $document_data['id']; @@ -1214,7 +1215,10 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) { $row[] = $size; $row[] = $document_name; - $total_size = $total_size + $size; + if (!isset($countedPaths[$document_data['path']])) { + $total_size = $total_size + $size; + $countedPaths[$document_data['path']] = true; + } if ((isset($_GET['keyword']) && search_keyword($document_name, $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) { $sortable_data[] = $row;