lib/kolab_client_task.php
Aleksander Machniak
machniak at kolabsys.com
Wed Sep 26 12:16:31 CEST 2012
lib/kolab_client_task.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit ef061d1acbb3c90e6ca6bc526b66a33edb475eb7
Author: Aleksander Machniak <alec at alec.pl>
Date: Wed Sep 26 12:16:07 2012 +0200
Check result type to prevent from PHP warnings
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index f3f0aa0..1ab8e9d 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -558,7 +558,7 @@ class kolab_client_task
$result = $this->api->post($type . '_types.list');
$list = $result->get('list');
- if (!empty($used_for)) {
+ if (!empty($used_for) && is_array($list)) {
foreach ($list as $type_id => $type_attrs) {
if ($type_attrs['used_for'] != $used_for) {
unset($list[$type_id]);
@@ -566,7 +566,7 @@ class kolab_client_task
}
}
- $this->cache[$cache_idx] = $list;
+ $this->cache[$cache_idx] = empty($list) ? $list : array();
Log::trace("kolab_client_task::${type}_types() returns: " . var_export($list, true));
}
More information about the commits
mailing list