SIP Status: Updates for PHP 8.1

This commit is contained in:
fusionate
2023-05-29 19:48:18 +00:00
parent 80dd552e15
commit 437024d3ed
2 changed files with 7 additions and 11 deletions

View File

@@ -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('<strong>'.$profile.'</strong> '.$result, 'alert', 3000);
}
else {
else if (!empty($result)) {
message::add($result, 'alert');
}

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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 "<tr class='list-row' href='".$list_row_url."'>\n";
echo " <td>";
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 "<tr class='list-row' href='".$list_row_url."'>\n";
echo " <td>";
if ($_SESSION["domain_name"] == $gateway_domain_name) {