From d1b5fc6bc1b0fda806db5a94eaf3729f1404d18b Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Wed, 1 Mar 2023 11:04:00 +0100 Subject: [PATCH] removed function from FOR loop test part --- htdocs/ticket/class/ticket.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 45e3cf361b3..ce0997c7a02 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -3050,11 +3050,12 @@ class Ticket extends CommonObject $sql .= " WHERE IF(tc.source = 'external', sc.statut = 1, u.statut = 1)"; $resql = $db->query($sql); if ($resql) { - for ($i = 0; $db->num_rows($resql) > $i; $i++) { + $num = $db->num_rows($resql); + for ($i = 0; $num > $i; $i++) { $non_closed_contacts[] = $db->fetch_row($resql); } } - $to = array_filter($to, function ($v, $k) use ($non_closed_contacts, $langs) { + $to = array_filter($to, function($v, $k) use($non_closed_contacts, $langs) { foreach ($non_closed_contacts as $non_closed_contact) { if ($k == $non_closed_contact[0]) return true;