diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index 79d31f4a55..19627efa54 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -1,27 +1,27 @@ - Portions created by the Initial Developer are Copyright (C) 2008-2020 - the Initial Developer. All Rights Reserved. + The Initial Developer of the Original Code is + Mark J Crane + Portions created by the Initial Developer are Copyright (C) 2008 - 2022 + the Initial Developer. All Rights Reserved. - Contributor(s): - Mark J Crane + Contributor(s): + Mark J Crane */ //set the include path @@ -46,19 +46,26 @@ $text = $language->get(); //get the domain_uuid - if (is_uuid($_GET['id'])) { + if (!empty($_GET['id']) && is_uuid($_GET['id'])) { $domain_uuid = $_GET['id']; } +//set additional variables + //$search = !empty($_GET["search"]) ? $_GET["search"] : ''; + $show = !empty($_GET["show"]) ? $_GET["show"] : ''; + +//set from session variables + $list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false'; + //get the http post data - if ($_POST['action'] != '') { - $action = $_POST['action']; - $domain_uuid = $_POST['domain_uuid']; - $domain_settings = $_POST['domain_settings']; - $domain_uuid_target = $_POST['domain_uuid_target']; + if (!empty($_POST['action'])) { + $action = $_POST['action'] ?? ''; + $domain_uuid = $_POST['domain_uuid'] ?? ''; + $domain_settings = $_POST['domain_settings'] ?? ''; + $domain_uuid_target = $_POST['domain_uuid_target'] ?? ''; //process the http post data by action - if (is_array($domain_settings) && @sizeof($domain_settings) != 0) { + if (!empty($domain_settings)) { switch ($action) { case 'copy': if (permission_exists('domain_setting_add') && permission_exists('domain_select') && count($_SESSION['domains']) > 1) { @@ -90,9 +97,9 @@ exit; } -//get the variables - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; +//get order and order by and sanitize the values + $order_by = $_GET["order_by"] ?? ''; + $order = $_GET["order"] ?? ''; //get the domain_name $sql = "select domain_name from v_domains "; @@ -121,7 +128,7 @@ } $parameters['domain_uuid'] = $domain_uuid; $database = new database; - $domain_settings = $database->select($sql, $parameters, 'all'); + $domain_settings = $database->select($sql, $parameters ?? null, 'all'); unset($sql, $parameters); //create token @@ -133,12 +140,7 @@ require_once "resources/header.php"; //copy settings javascript - if ( - permission_exists("domain_select") && - permission_exists("domain_setting_add") && - is_array($_SESSION['domains']) && - @sizeof($_SESSION['domains']) > 1 - ) { + if (permission_exists("domain_select") && permission_exists("domain_setting_add") && !empty($_SESSION['domains'])) { echo "