From 7a0fbaeb8e81b712224cae66755e695f2fbd9112 Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 2 Jun 2023 17:46:10 +0000 Subject: [PATCH] Call Forward (FM & DND): Updates for PHP 8.1 --- app/call_forward/resources/classes/call_forward.php | 8 ++++---- app/call_forward/resources/classes/do_not_disturb.php | 8 ++++---- app/call_forward/resources/classes/follow_me.php | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/call_forward/resources/classes/call_forward.php b/app/call_forward/resources/classes/call_forward.php index 716b1ef4bb..746286dced 100644 --- a/app/call_forward/resources/classes/call_forward.php +++ b/app/call_forward/resources/classes/call_forward.php @@ -18,7 +18,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 - 2022 + Copyright (C) 2010 - 2023 All Rights Reserved. Contributor(s): @@ -143,7 +143,7 @@ //get current toggle state foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'" . $record['uuid'] . "'"; } } @@ -227,7 +227,7 @@ $p->delete('extension_edit', 'temp'); //send feature event notify to the phone - if ($_SESSION['device']['feature_sync']['boolean'] == "true") { + if (!empty($_SESSION['device']['feature_sync']['boolean']) && $_SESSION['device']['feature_sync']['boolean'] == "true") { foreach ($extensions as $uuid => $extension) { $feature_event_notify = new feature_event_notify; $feature_event_notify->domain_name = $_SESSION['domain_name']; @@ -247,7 +247,7 @@ } //synchronize configuration - if (is_readable($_SESSION['switch']['extensions']['dir'])) { + if (!empty($_SESSION['switch']['extensions']['dir']) && is_readable($_SESSION['switch']['extensions']['dir'])) { require_once "app/extensions/resources/classes/extension.php"; $ext = new extension; $ext->xml(); diff --git a/app/call_forward/resources/classes/do_not_disturb.php b/app/call_forward/resources/classes/do_not_disturb.php index 9130743acd..7a6996d8b8 100644 --- a/app/call_forward/resources/classes/do_not_disturb.php +++ b/app/call_forward/resources/classes/do_not_disturb.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 - 2016 + Copyright (C) 2010 - 2023 All Rights Reserved. Contributor(s): @@ -163,7 +163,7 @@ //get current toggle state foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -240,7 +240,7 @@ $p->delete('extension_edit', 'temp'); //send feature event notify to the phone - if ($_SESSION['device']['feature_sync']['boolean'] == "true") { + if (!empty($_SESSION['device']['feature_sync']['boolean']) && $_SESSION['device']['feature_sync']['boolean'] == "true") { foreach ($extensions as $uuid => $extension) { $feature_event_notify = new feature_event_notify; $feature_event_notify->domain_name = $_SESSION['domain_name']; @@ -260,7 +260,7 @@ } //synchronize configuration - if (is_readable($_SESSION['switch']['extensions']['dir'])) { + if (!empty($_SESSION['switch']['extensions']['dir']) && is_readable($_SESSION['switch']['extensions']['dir'])) { require_once "app/extensions/resources/classes/extension.php"; $ext = new extension; $ext->xml(); diff --git a/app/call_forward/resources/classes/follow_me.php b/app/call_forward/resources/classes/follow_me.php index 177ae99552..4a0c848c55 100644 --- a/app/call_forward/resources/classes/follow_me.php +++ b/app/call_forward/resources/classes/follow_me.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2010 - 2019 + Copyright (C) 2010 - 2023 All Rights Reserved. Contributor(s): @@ -307,7 +307,7 @@ //get current toggle state foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -353,7 +353,7 @@ $extension['state'] == $this->toggle_values[1] //false becoming true && is_uuid($extension['follow_me_uuid']) ) { - $sql .= "select count(*) from v_follow_me_destinations where follow_me_uuid = :follow_me_uuid"; + $sql = "select count(*) from v_follow_me_destinations where follow_me_uuid = :follow_me_uuid"; $parameters['follow_me_uuid'] = $extension['follow_me_uuid']; $database = new database; $num_rows = $database->select($sql, $parameters, 'column'); @@ -405,7 +405,7 @@ $p->delete('follow_me_edit', 'temp'); //send feature event notify to the phone - if ($_SESSION['device']['feature_sync']['boolean'] == "true") { + if (!empty($_SESSION['device']['feature_sync']['boolean']) && $_SESSION['device']['feature_sync']['boolean'] == "true") { foreach ($extensions as $uuid => $extension) { $feature_event_notify = new feature_event_notify; $feature_event_notify->domain_name = $_SESSION['domain_name']; @@ -425,7 +425,7 @@ } //synchronize configuration - if (is_readable($_SESSION['switch']['extensions']['dir'])) { + if (!empty($_SESSION['switch']['extensions']['dir']) && is_readable($_SESSION['switch']['extensions']['dir'])) { require_once "app/extensions/resources/classes/extension.php"; $ext = new extension; $ext->xml();