summaryrefslogtreecommitdiffstats
path: root/application/service
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-04 07:42:05 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-04 07:58:15 +0200
commit1ac83a99d3c7188f74ca4ecdec77a98ec9cef338 (patch)
tree216e960f4ddbd75c448311c399dad61142d33d65 /application/service
parent6b7fd633b9866806a37beca1e9a099a0dc24d68d (diff)
service\files->get_multipaste_history: Add sort order from DB
Keep this field private for now. I may be exposed at a later time. The returned values are already normalized so they can be safely exposed. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service')
-rw-r--r--application/service/files.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/application/service/files.php b/application/service/files.php
index 8f7595c50..d1318c4d4 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -70,10 +70,17 @@ class files {
->join("multipaste_file_map mfm", "m.multipaste_id = mfm.multipaste_id")
->join("files f", "f.id = mfm.file_url_id")
->where("m.user_id", $user)
+ ->order_by("mfm.sort_order")
->get()->result_array();
+ $counter = 0;
+
foreach ($multipaste_items_query as $item) {
- $multipaste_info[$item["url_id"]]["items"][$item["id"]] = array("id" => $item["id"]);
+ $multipaste_info[$item["url_id"]]["items"][$item["id"]] = array(
+ "id" => $item["id"],
+ // normalize sort_order value so we don't leak any information
+ "sort_order" => $counter++,
+ );
}
// No idea why, but this can/could happen so be more forgiving and clean up