]> wagnertech.de Git - timetracker.git/blobdiff - time.php
Got rid of PHP warnning when argument is not an array
[timetracker.git] / time.php
index 60b396a6414733e6096a81c5a0ebd3b9daf6d25d..f290e55b8f0feaf4aa750674fb9e60bd4e9eca0a 100644 (file)
--- a/time.php
+++ b/time.php
@@ -145,11 +145,12 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t
     // 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;
-         }
+      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);',