summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-01-11 23:35:38 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-01-16 17:38:38 +0100
commit01c881fd2c0f0c701a83e135f2142c9db3052422 (patch)
treec596b76c4b71f941c3a691977a3042a8fdf7acb1 /application
parentc8e5f5a20c9e558efbd5e9c152f086ab72015ba3 (diff)
fix multipaste in service/history
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-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