summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/file.php2
-rw-r--r--application/service/files.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 57faa62f2..5fce8afc8 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -643,7 +643,7 @@ class File extends MY_Controller {
foreach ($history["multipaste_items"] as $key => $item) {
$size = 0;
foreach ($item["items"] as $i) {
- $size += $i["filesize"];
+ $size += $history["items"][$i["id"]]["filesize"];
}
$history["items"][] = array(
diff --git a/application/service/files.php b/application/service/files.php
index b4bf7b9ee..8d0760b87 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -14,12 +14,16 @@ class files {
static public function history($user)
{
$CI =& get_instance();
+ $items = array();
$fields = array("id", "filename", "mimetype", "date", "hash", "filesize");
- $items = $CI->db->select(implode(',', $fields))
+ $query = $CI->db->select(implode(',', $fields))
->from('files')
->where('user', $user)
->get()->result_array();
+ foreach ($query as $key => $item) {
+ $items[$item["id"]] = $item;
+ }
$total_size = $CI->db->query("
SELECT sum(filesize) sum