summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_service.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kolab_api_service.php')
-rw-r--r--lib/kolab_api_service.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index dfe69ea..f1b0b95 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -60,8 +60,8 @@ abstract class kolab_api_service
protected function object_type_attributes($object_name, $type_id, $required = true)
{
$supported = array('group', 'user');
- if (!in_array($object_name, $supported)) {
-
+ if (!$object_name || !in_array($object_name, $supported)) {
+ return array();
}
if (empty($type_id)) {
@@ -141,15 +141,15 @@ abstract class kolab_api_service
*/
protected function object_types($object_name)
{
- if (!empty($this->cache['object_types']) && !empty($this->cache['object_types'][$object_name])) {
- return $this->cache['object_types'][$object_name];
- }
-
$supported = array('group', 'user');
- if (!in_array($object_name, $supported)) {
+ if (!$object_name || !in_array($object_name, $supported)) {
return array();
}
+ if (!empty($this->cache['object_types']) && !empty($this->cache['object_types'][$object_name])) {
+ return $this->cache['object_types'][$object_name];
+ }
+
$sql_result = $this->db->query("SELECT * FROM {$object_name}_types");
$object_types = array();