summaryrefslogtreecommitdiffstats
path: root/application/controllers/api/v2
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-07-04 11:58:38 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-07-04 12:10:49 +0200
commit56f176309428541e6868cb9c4a89f51f5cbdd2f8 (patch)
tree2aa5a7fde0ebaa28380330ca77c08a5bb76cf613 /application/controllers/api/v2
parent9bdf0973b337cbf73287422cc5fdceabc8703e61 (diff)
Create function for ensuring that json keys contain objects
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/api/v2')
-rw-r--r--application/controllers/api/v2/file.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/application/controllers/api/v2/file.php b/application/controllers/api/v2/file.php
index 5dedcd508..c3a42388b 100644
--- a/application/controllers/api/v2/file.php
+++ b/application/controllers/api/v2/file.php
@@ -66,11 +66,7 @@ class file extends \controllers\api\api_controller {
}
}
- foreach (array("items", "multipaste_items") as $key) {
- if (empty($history[$key])) {
- $history[$key] = (object) array();
- }
- }
+ $history = ensure_json_keys_contain_objects($history, array("items", "multipaste_items"));
return $history;
}