]> wagnertech.de Git - timetracker.git/blobdiff - mobile/time.php
Got rid of PHP warnning when argument is not an array
[timetracker.git] / mobile / time.php
index 0e787fc612700928186c34eb64c9c42bb976976b..dda3767c0b80c46612c4c03883e5f5a16e032be6 100644 (file)
@@ -125,12 +125,13 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t
     // Build a client list out of active clients. Use only clients that are relevant to user.
     // Also trim their associated project list to only assigned projects (to user).
     foreach($active_clients as $client) {
-         $projects_assigned_to_client = explode(',', $client['projects']);
-         $intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
-         if ($intersection) {
-           $client['projects'] = implode(',', $intersection);
-           $client_list[] = $client;
-         }
+      $projects_assigned_to_client = explode(',', $client['projects']);
+      if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user))
+        $intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
+      if ($intersection) {
+        $client['projects'] = implode(',', $intersection);
+        $client_list[] = $client;
+      }
     }
     $form->addInput(array('type'=>'combobox',
       'onchange'=>'fillProjectDropdown(this.value);',
@@ -305,3 +306,4 @@ $smarty->assign('timestring', $selected_date->toString($user->date_format));
 $smarty->assign('title', $i18n->getKey('title.time'));
 $smarty->assign('content_page_name', 'mobile/time.tpl');
 $smarty->display('mobile/index.tpl');
+?>
\ No newline at end of file