summaryrefslogtreecommitdiffstats
path: root/application/controllers/api
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/controllers/api
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/controllers/api')
-rw-r--r--application/controllers/api/v1/file.php5
-rw-r--r--application/controllers/api/v2/file.php6
2 files changed, 10 insertions, 1 deletions
diff --git a/application/controllers/api/v1/file.php b/application/controllers/api/v1/file.php
index dae053db2..784f42555 100644
--- a/application/controllers/api/v1/file.php
+++ b/application/controllers/api/v1/file.php
@@ -62,6 +62,11 @@ class file extends \controllers\api\api_controller {
foreach ($history['items'] as $key => $item) {
unset($history['items'][$key]['thumbnail']);
}
+ foreach ($history['multipaste_items'] as $key => $multipaste_item) {
+ foreach ($multipaste_item['items'] as $inner_key => $item) {
+ unset($history['multipaste_items'][$key]['items'][$inner_key]['sort_order']);
+ }
+ }
return $history;
}
diff --git a/application/controllers/api/v2/file.php b/application/controllers/api/v2/file.php
index ba80ae309..ebe717f73 100644
--- a/application/controllers/api/v2/file.php
+++ b/application/controllers/api/v2/file.php
@@ -59,10 +59,14 @@ class file extends \controllers\api\api_controller {
{
$this->muser->require_access("apikey");
$history = \service\files::history($this->muser->get_userid());
- # APIv1-cleanup: Remove this
foreach ($history['multipaste_items'] as $key => $item) {
+ # APIv1-cleanup: Remove this
unset($history['multipaste_items'][$key]['user_id']);
unset($history['multipaste_items'][$key]['multipaste_id']);
+
+ foreach ($item['items'] as $inner_key => $item) {
+ unset($history['multipaste_items'][$key]['items'][$inner_key]['sort_order']);
+ }
}
return $history;
}