Răsfoiți Sursa

Update database.php

FusionPBX 6 ani în urmă
părinte
comite
2f63736ea9
1 a modificat fișierele cu 9 adăugiri și 9 ștergeri
  1. 9 9
      resources/classes/database.php

+ 9 - 9
resources/classes/database.php

@@ -790,13 +790,13 @@ include "root.php";
 						$sql .= "(";
 						$sql .= "database_transaction_uuid, ";
 						$sql .= "domain_uuid, ";
-						if (strlen($user_uuid) > 0) {
+						if (isset($user_uuid) && is_uuid($user_uuid)) {
 							$sql .= "user_uuid, ";
 						}
-						if (strlen($this->app_uuid) > 0) {
+						if (isset($this->app_uuid) && is_uuid($this->app_uuid)) {
 							$sql .= "app_uuid, ";
 						}
-						if (strlen($this->app_name) > 0) {
+						if (isset($this->app_name) && strlen($this->app_name) > 0) {
 							$sql .= "app_name, ";
 						}
 						$sql .= "transaction_code, ";
@@ -811,13 +811,13 @@ include "root.php";
 						$sql .= "(";
 						$sql .= "'".uuid()."', ";
 						$sql .= "'".$this->domain_uuid."', ";
-						if (strlen($user_uuid) > 0) {
+						if (isset($user_uuid) && is_uuid($user_uuid)) {
 							$sql .= ":user_uuid, ";
 						}
-						if (strlen($this->app_uuid) > 0) {
+						if (isset($this->app_uuid) && is_uuid($this->app_uuid)) {
 							$sql .= ":app_uuid, ";
 						}
-						if (strlen($this->app_name) > 0) {
+						if (isset($this->app_name) && strlen($this->app_name) > 0) {
 							$sql .= ":app_name, ";
 						}
 						$sql .= "'".$message["code"]."', ";
@@ -839,13 +839,13 @@ include "root.php";
 						$sql .= ":transaction_result ";
 						$sql .= ")";
 						$statement = $this->db->prepare($sql);
-						if (strlen($user_uuid) > 0) {
+						if (isset($user_uuid) && is_uuid($user_uuid)) {
 							$statement->bindParam(':user_uuid', $user_uuid);
 						}
-						if (strlen($this->app_uuid) > 0) {
+						if (isset($this->app_uuid) && is_uuid($this->app_uuid)) {
 							$statement->bindParam(':app_uuid', $this->app_uuid);
 						}
-						if (strlen($this->app_name) > 0) {
+						if (isset($this->app_name) && strlen($this->app_name) > 0) {
 							$statement->bindParam(':app_name', $this->app_name);
 						}
 						$statement->bindParam(':remote_address', $_SERVER['REMOTE_ADDR']);