From c7e567b2d24dcdf2f9dba5e4ed3743a97f519c4d Mon Sep 17 00:00:00 2001 From: fusionate Date: Tue, 6 Jun 2023 21:44:10 +0000 Subject: [PATCH] Domain - Edit: Updates for PHP 8.1 --- core/domains/domain_edit.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index 126ee21af7..e6fe64fc86 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.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-2022 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -69,7 +69,7 @@ //get http post variables and set them to php variables if (!empty($_POST)) { $domain_name = strtolower($_POST["domain_name"]); - $domain_enabled = $_POST["domain_enabled"] ?: 'false'; + $domain_enabled = $_POST["domain_enabled"] ?? 'false'; $domain_description = $_POST["domain_description"]; } @@ -83,7 +83,7 @@ //delete the domain if (permission_exists('domain_delete')) { - if ($_POST['action'] == 'delete' && is_uuid($domain_uuid)) { + if (!empty($_POST['action']) && $_POST['action'] == 'delete' && is_uuid($domain_uuid)) { //prepare $array[0]['checked'] = 'true'; $array[0]['uuid'] = $domain_uuid; @@ -214,7 +214,7 @@ if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplans/app_config.php")) { //import the dialplans $dialplan = new dialplan; - $dialplan->import($array['domains']); + $dialplan->import($array['domains'] ?? null); unset($array); //add xml for each dialplan where the dialplan xml is empty @@ -614,7 +614,7 @@ echo "\n"; echo " $(document).ready(function() {\n"; echo " $('#domain_setting_search').trigger('focus');\n"; - if ($search == '') { + if (!empty($search)) { echo " // scroll to previous category\n"; echo " var category_span_id;\n"; echo " var url = document.location.href;\n";