diff --git a/app/messages/index.php b/app/messages/index.php index c5f6ae24b8..62137d56c7 100644 --- a/app/messages/index.php +++ b/app/messages/index.php @@ -45,6 +45,7 @@ $user_uuid = $row['user_uuid']; $authorized = true; } + unset($sql, $parameters, $row); //authorization failed if (!$authorized) { diff --git a/app/messages/messages_contacts.php b/app/messages/messages_contacts.php index 061a3b1709..8b5c0d974e 100644 --- a/app/messages/messages_contacts.php +++ b/app/messages/messages_contacts.php @@ -82,8 +82,16 @@ $numbers[] = $number_to; } switch ($message['message_direction']) { - case 'inbound': $contact[$number_from]['contact_uuid'] = $message['contact_uuid']; break; - case 'outbound': $contact[$number_to]['contact_uuid'] = $message['contact_uuid']; break; + case 'inbound': + if (!is_uuid($contact[$number_from]['contact_uuid'])) { + $contact[$number_from]['contact_uuid'] = $message['contact_uuid']; + } + break; + case 'outbound': + if (!is_uuid($contact[$number_to]['contact_uuid'])) { + $contact[$number_to]['contact_uuid'] = $message['contact_uuid']; + } + break; } unset($number_from, $number_to); } @@ -131,8 +139,14 @@ } } unset($sql, $parameters, $rows, $row); - - if (!is_null(array_diff($numbers, $destinations))) { + + if ( + is_array($numbers) && + @sizeof($numbers) != 0 && + is_array($destinations) && + @sizeof($destinations) != 0 && + !is_null(array_diff($numbers, $destinations)) + ) { $numbers = array_diff($numbers, $destinations); } @@ -209,9 +223,6 @@ echo "\n"; } echo "\n"; - echo "
\n"; - echo " \"".$text['label-refresh_pause']."\" "; - echo "
\n"; echo "\n"; } + else { + echo "
···
"; + } + + echo "
\n"; + echo " \"".$text['label-refresh_pause']."\" "; + echo "
\n"; ?> \ No newline at end of file