From d88fec52bfd8bff0196a1d32a1ffc5f2349afd48 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 20 Jul 2019 15:07:59 +0200 Subject: [PATCH 1/3] fix warining message --- htdocs/comm/action/peruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 9e2a7278a27..65669625398 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1189,8 +1189,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } $ids1='';$ids2=''; - if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h])); - if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h])); + if (is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h])); + if (is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h])); if ($h == $begin_h) echo ''; else echo ''; From d03d79222e9ecfd239a49566dd8695ceac5841c3 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 20 Jul 2019 15:15:48 +0200 Subject: [PATCH 2/3] fix warning php --- htdocs/comm/action/peruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 65669625398..7dfe197033e 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1207,14 +1207,14 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $color1='222222'; } - if (count($cases2[$h]) == 1) // only 1 event + if (is_array($cases2[$h]) && count($cases2[$h]) == 1) // only 1 event { $output = array_slice($cases2[$h], 0, 1); $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string']; if ($output[0]['color']) $color2 = $output[0]['color']; } - else if (count($cases2[$h]) > 1) + else if (is_array($cases2[$h]) && count($cases2[$h]) > 1) { $title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:''); $color2='222222'; From b046bcc197a0b8d0b800c1153ace0e76de4e988f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 20 Jul 2019 15:19:25 +0200 Subject: [PATCH 3/3] fix warning php --- htdocs/comm/action/peruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 7dfe197033e..16d9f09947c 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1194,14 +1194,14 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($h == $begin_h) echo ''; else echo ''; - if (count($cases1[$h]) == 1) // only 1 event + if (is_array($cases1[$h]) && count($cases1[$h]) == 1) // only 1 event { $output = array_slice($cases1[$h], 0, 1); $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string']; if ($output[0]['color']) $color1 = $output[0]['color']; } - else if (count($cases1[$h]) > 1) + else if (is_array($cases1[$h]) && count($cases1[$h]) > 1) { $title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:''); $color1='222222';