Prechádzať zdrojové kódy

extension_settings and domains php 8.1 changes (#6737)

* Update extension_settings.php

* Update extension_setting_edit.php

* Update extension_edit.php

* Update domain_edit.php

* Update domain_json.php

* Update extension_setting_edit.php
Alex 2 rokov pred
rodič
commit
1d96a46411

+ 8 - 4
core/domains/domain_edit.php

@@ -46,6 +46,10 @@
 	$language = new text;
 	$text = $language->get();
 
+//set the defaults
+	$domain_name = '';
+	$domain_description = '';
+
 //action add or update
 	if (!permission_exists('domain_add') || (file_exists($_SERVER["PROJECT_ROOT"]."/app/domains/") && !permission_exists('domain_all'))) {
 		//admin editing own domain/settings
@@ -53,7 +57,7 @@
 		$action = "update";
 	}
 	else {
-		if (is_uuid($_REQUEST["id"])) {
+		if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
 			$action = "update";
 			$domain_uuid = $_REQUEST["id"];
 		}
@@ -63,14 +67,14 @@
 	}
 
 //get http post variables and set them to php variables
-	if (count($_POST) > 0) {
+	if (!empty($_POST)) {
 		$domain_name = strtolower($_POST["domain_name"]);
 		$domain_enabled = $_POST["domain_enabled"] ?: 'false';
 		$domain_description = $_POST["domain_description"];
 	}
 
 //process the data
-	if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
+	if (!empty($_POST) && empty($_POST["persistformvar"])) {
 
 		//get the domain_uuid
 			if ($action == "update" && $_POST["domain_uuid"]) {
@@ -118,7 +122,7 @@
 			}
 
 		//add or update the database
-			if ($_POST["persistformvar"] != "true") {
+			if (empty($_POST["persistformvar"])) {
 				if ($action == "add" && permission_exists('domain_add')) {
 					$sql = "select count(*) from v_domains ";
 					$sql .= "where lower(domain_name) = :domain_name ";

+ 1 - 1
core/domains/domain_json.php

@@ -77,7 +77,7 @@
 		}
 		$sql .= "order by domain_name asc ";
 		$database = new database;
-		$domains = $database->select($sql, $parameters ?? '', 'all');
+		$domains = $database->select($sql, $parameters ?? null, 'all');
 		unset($sql, $parameters);
 	}