Skip to content

Commit 74704a7

Browse files
committed
Got rid of PHP warnning when argument is not an array
1 parent e457063 commit 74704a7

5 files changed

Lines changed: 29 additions & 23 deletions

File tree

WEB-INF/templates/footer.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<br>
1313
<table cellspacing="0" cellpadding="4" width="100%" border="0">
1414
<tr>
15-
<td align="center">&nbsp;Anuko Time Tracker 1.9.15.3414 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
15+
<td align="center">&nbsp;Anuko Time Tracker 1.9.15.3415 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
1616
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
1717
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
1818
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>

mobile/time.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@
125125
// Build a client list out of active clients. Use only clients that are relevant to user.
126126
// Also trim their associated project list to only assigned projects (to user).
127127
foreach($active_clients as $client) {
128-
$projects_assigned_to_client = explode(',', $client['projects']);
129-
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
130-
if ($intersection) {
131-
$client['projects'] = implode(',', $intersection);
132-
$client_list[] = $client;
133-
}
128+
$projects_assigned_to_client = explode(',', $client['projects']);
129+
if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user))
130+
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
131+
if ($intersection) {
132+
$client['projects'] = implode(',', $intersection);
133+
$client_list[] = $client;
134+
}
134135
}
135136
$form->addInput(array('type'=>'combobox',
136137
'onchange'=>'fillProjectDropdown(this.value);',
@@ -305,3 +306,4 @@
305306
$smarty->assign('title', $i18n->getKey('title.time'));
306307
$smarty->assign('content_page_name', 'mobile/time.tpl');
307308
$smarty->display('mobile/index.tpl');
309+
?>

mobile/time_edit.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@
143143
// Build a client list out of active clients. Use only clients that are relevant to user.
144144
// Also trim their associated project list to only assigned projects (to user).
145145
foreach($active_clients as $client) {
146-
$projects_assigned_to_client = explode(',', $client['projects']);
147-
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
148-
if ($intersection) {
149-
$client['projects'] = implode(',', $intersection);
150-
$client_list[] = $client;
151-
}
146+
$projects_assigned_to_client = explode(',', $client['projects']);
147+
if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user))
148+
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
149+
if ($intersection) {
150+
$client['projects'] = implode(',', $intersection);
151+
$client_list[] = $client;
152+
}
152153
}
153154
$form->addInput(array('type'=>'combobox',
154155
'onchange'=>'fillProjectDropdown(this.value);',
@@ -347,3 +348,4 @@
347348
$smarty->assign('title', $i18n->getKey('title.edit_time_record'));
348349
$smarty->assign('content_page_name', 'mobile/time_edit.tpl');
349350
$smarty->display('mobile/index.tpl');
351+
?>

time.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@
145145
// Also trim their associated project list to only assigned projects (to user).
146146
foreach($active_clients as $client) {
147147
$projects_assigned_to_client = explode(',', $client['projects']);
148-
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
149-
if ($intersection) {
150-
$client['projects'] = implode(',', $intersection);
151-
$client_list[] = $client;
152-
}
148+
if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user))
149+
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
150+
if ($intersection) {
151+
$client['projects'] = implode(',', $intersection);
152+
$client_list[] = $client;
153+
}
153154
}
154155
$form->addInput(array('type'=>'combobox',
155156
'onchange'=>'fillProjectDropdown(this.value);',

time_edit.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@
143143
// Build a client list out of active clients. Use only clients that are relevant to user.
144144
// Also trim their associated project list to only assigned projects (to user).
145145
foreach($active_clients as $client) {
146-
$projects_assigned_to_client = explode(',', $client['projects']);
147-
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
148-
if ($intersection) {
146+
$projects_assigned_to_client = explode(',', $client['projects']);
147+
if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user))
148+
$intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user);
149+
if ($intersection) {
149150
$client['projects'] = implode(',', $intersection);
150-
$client_list[] = $client;
151-
}
151+
$client_list[] = $client;
152+
}
152153
}
153154
$form->addInput(array('type'=>'combobox',
154155
'onchange'=>'fillProjectDropdown(this.value);',

0 commit comments

Comments
 (0)