From 572a243a7bea1d463fbe653d528cc025ab741b23 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Wed, 1 Mar 2023 19:20:02 +0100 Subject: [PATCH 1/2] Fix scheduled no with no phone on PHP < 8 --- VERSION | 2 +- controllers/publics/Scheduled.php | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index c7c6e80..b9bf9ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.6.1 +v3.6.2 diff --git a/controllers/publics/Scheduled.php b/controllers/publics/Scheduled.php index eb2decb..5980935 100644 --- a/controllers/publics/Scheduled.php +++ b/controllers/publics/Scheduled.php @@ -441,9 +441,12 @@ namespace controllers\publics; $mms = (bool) count($media_ids); // Check if we must send message to a phone or a phone_group based on if id_phone start with 'phone_' or 'phonegroup_' - $original_id_phone = $id_phone; - $id_phone = str_starts_with($original_id_phone, 'phone_') ? mb_substr($original_id_phone, mb_strlen('phone_')) : null; - $id_phone_group = str_starts_with($original_id_phone, 'phonegroup_') ? mb_substr($original_id_phone, mb_strlen('phonegroup_')) : null; + $id_phone_group = null; + if ($id_phone) + { + $id_phone_group = str_starts_with($id_phone, 'phonegroup_') ? mb_substr($id_phone, mb_strlen('phonegroup_')) : null; + $id_phone = str_starts_with($id_phone, 'phone_') ? mb_substr($id_phone, mb_strlen('phone_')) : null; + } $scheduled_id = $this->internal_scheduled->create($id_user, $at, $text, $id_phone, $id_phone_group, $flash, $mms, $tag, $numbers, $contacts, $groups, $conditional_groups, $media_ids); if (!$scheduled_id) @@ -663,10 +666,13 @@ namespace controllers\publics; $mms = (bool) count($media_ids); - $original_id_phone = $id_phone; - $id_phone = str_starts_with($original_id_phone, 'phone_') ? mb_substr($original_id_phone, mb_strlen('phone_')) : null; - $id_phone_group = str_starts_with($original_id_phone, 'phonegroup_') ? mb_substr($original_id_phone, mb_strlen('phonegroup_')) : null; - + $id_phone_group = null; + if ($id_phone) + { + $id_phone_group = str_starts_with($id_phone, 'phonegroup_') ? mb_substr($id_phone, mb_strlen('phonegroup_')) : null; + $id_phone = str_starts_with($id_phone, 'phone_') ? mb_substr($id_phone, mb_strlen('phone_')) : null; + } + $this->internal_scheduled->update_for_user($id_user, $id_scheduled, $at, $text, $id_phone, $id_phone_group, $flash, $mms, $tag, $numbers, $contacts, $groups, $conditional_groups, $media_ids); ++$nb_update; } From b8ab352debd016a48562825b98013f921ecff1f1 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Wed, 1 Mar 2023 19:34:51 +0100 Subject: [PATCH 2/2] Fix bad offset on invalid csv file while importing contact --- VERSION | 2 +- controllers/internals/Contact.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b9bf9ed..50dde2d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.6.2 +v3.6.3 diff --git a/controllers/internals/Contact.php b/controllers/internals/Contact.php index ffb37a9..2d8afee 100644 --- a/controllers/internals/Contact.php +++ b/controllers/internals/Contact.php @@ -160,7 +160,7 @@ namespace controllers\internals; continue; } - if (!isset($line[array_keys($line)[0]], $line[array_keys($line)[1]])) + if (!isset(array_keys($line)[0], array_keys($line)[1])) { continue; }