From 437024d3ed526d03af5a1bc8b3b2e8a9d3bc7b8d Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 29 May 2023 19:48:18 +0000 Subject: [PATCH] SIP Status: Updates for PHP 8.1 --- app/sip_status/cmd.php | 8 ++++---- app/sip_status/sip_status.php | 10 +++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/sip_status/cmd.php b/app/sip_status/cmd.php index fbcaf9274b..d526b85841 100644 --- a/app/sip_status/cmd.php +++ b/app/sip_status/cmd.php @@ -42,9 +42,9 @@ } //set the variables - $profile = $_GET['profile']; + $profile = $_GET['profile'] ?? null; $action = $_GET['action']; - $gateway = $_GET['gateway']; + $gateway = $_GET['gateway'] ?? null; //validate the sip profile name $sql = "select sip_profile_name from v_sip_profiles "; @@ -55,7 +55,7 @@ unset($sql, $parameters); //validate the gateway - if (is_uuid($_GET['gateway'])) { + if (!empty($_GET['gateway']) && is_uuid($_GET['gateway'])) { $gateway_name = $_GET['gateway']; } @@ -110,7 +110,7 @@ if (isset($profile) && strlen($profile)) { message::add(''.$profile.' '.$result, 'alert', 3000); } - else { + else if (!empty($result)) { message::add($result, 'alert'); } diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php index eef540e6ea..51c2385a59 100644 --- a/app/sip_status/sip_status.php +++ b/app/sip_status/sip_status.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -150,9 +150,7 @@ foreach ($xml->profile as $row) { unset($list_row_url); $profile_name = (string) $row->name; - if (is_uuid($sip_profiles[$profile_name]) && permission_exists('sip_profile_edit')) { - $list_row_url = PROJECT_PATH."/app/sip_profiles/sip_profile_edit.php?id=".$sip_profiles[$profile_name]; - } + $list_row_url = is_uuid($sip_profiles[$profile_name]) && permission_exists('sip_profile_edit') ? PROJECT_PATH."/app/sip_profiles/sip_profile_edit.php?id=".$sip_profiles[$profile_name] : null; echo "\n"; echo " "; if ($list_row_url) { @@ -185,9 +183,7 @@ } } } - if ($_SESSION["domain_name"] == $gateway_domain_name) { - $list_row_url = PROJECT_PATH."/app/gateways/gateway_edit.php?id=".strtolower(escape($row->name)); - } + $list_row_url = $_SESSION["domain_name"] == $gateway_domain_name ? PROJECT_PATH."/app/gateways/gateway_edit.php?id=".strtolower(escape($row->name)) : null; echo "\n"; echo " "; if ($_SESSION["domain_name"] == $gateway_domain_name) {