summaryrefslogtreecommitdiffstats
path: root/application/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'application/helpers')
-rw-r--r--application/helpers/filebin_helper.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index 55fdf773d..c1a6f4f96 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -383,4 +383,13 @@ function return_bytes($size_str)
}
}
+function ensure_json_keys_contain_objects($data, $keys) {
+ foreach ($keys as $key) {
+ if (empty($data[$key])) {
+ $data[$key] = (object) array();
+ }
+ }
+ return $data;
+}
+
# vim: set noet: