summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-01-04 17:08:51 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-01-16 17:38:38 +0100
commit7f74792c2f82aee3cd98bd6304ced55894b43683 (patch)
tree8692e2cbeac5c50c3a7c558a06a3030b04a788f2 /application/controllers/file.php
parent0c53ebac6e0328aea4551f5f1a97783f34c82866 (diff)
Improve history api for multipastes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index ac2c4b4ca..5451836de 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -640,6 +640,22 @@ class File extends MY_Controller {
$lengths[$length_key] = mb_strlen($value);
}
+ foreach ($history["multipaste_items"] as $key => $item) {
+ $size = 0;
+ foreach ($item["items"] as $i) {
+ $size += $i["filesize"];
+ }
+
+ $history["items"][] = array(
+ "id" => $item["url_id"],
+ "filename" => count($item["items"])." file(s)",
+ "mimetype" => "",
+ "date" => $item["date"],
+ "hash" => "",
+ "filesize" => $size,
+ );
+ }
+
$order = is_cli_client() ? "ASC" : "DESC";
uasort($history["items"], function($a, $b) use ($order) {