From 6e936e177705270ff2c548158d997e8310b1ec36 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 20 Aug 2019 12:40:51 -0600 Subject: [PATCH] Update database.php --- resources/classes/database.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/classes/database.php b/resources/classes/database.php index 9766670f14..326060503e 100644 --- a/resources/classes/database.php +++ b/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']);