BugFix - database class app_uuid (#2663)
if $database->app_uuid is not set it would use '' in some conditions which isset would test true. This fix uses strlen instead, but also fixes number_transations app that highlighted the flaw
This commit is contained in:
@@ -106,6 +106,7 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$database->app_name = 'number_translations';
|
$database->app_name = 'number_translations';
|
||||||
|
$database->app_uuid = '6ad54de6-4909-11e7-a919-92ebcb67fe33';
|
||||||
$database->save($array);
|
$database->save($array);
|
||||||
if ($this->display_type == "text") {
|
if ($this->display_type == "text") {
|
||||||
if ($database->message['code'] != '200') {
|
if ($database->message['code'] != '200') {
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ include "root.php";
|
|||||||
public $count;
|
public $count;
|
||||||
public $sql;
|
public $sql;
|
||||||
public $result;
|
public $result;
|
||||||
|
public $app_name;
|
||||||
|
public $app_uuid;
|
||||||
|
|
||||||
public function connect() {
|
public function connect() {
|
||||||
|
|
||||||
@@ -881,7 +883,7 @@ include "root.php";
|
|||||||
$sql .= "database_transaction_uuid, ";
|
$sql .= "database_transaction_uuid, ";
|
||||||
$sql .= "domain_uuid, ";
|
$sql .= "domain_uuid, ";
|
||||||
$sql .= "user_uuid, ";
|
$sql .= "user_uuid, ";
|
||||||
if (isset($this->app_uuid)) {
|
if (strlen($this->app_uuid) > 0) {
|
||||||
$sql .= "app_uuid, ";
|
$sql .= "app_uuid, ";
|
||||||
}
|
}
|
||||||
$sql .= "app_name, ";
|
$sql .= "app_name, ";
|
||||||
@@ -898,7 +900,7 @@ include "root.php";
|
|||||||
$sql .= "'".uuid()."', ";
|
$sql .= "'".uuid()."', ";
|
||||||
$sql .= "'".$domain_uuid."', ";
|
$sql .= "'".$domain_uuid."', ";
|
||||||
$sql .= "'".$_SESSION['user_uuid']."', ";
|
$sql .= "'".$_SESSION['user_uuid']."', ";
|
||||||
if (isset($this->app_uuid)) {
|
if (strlen($this->app_uuid) > 0) {
|
||||||
$sql .= "'".$this->app_uuid."', ";
|
$sql .= "'".$this->app_uuid."', ";
|
||||||
}
|
}
|
||||||
$sql .= "'".$this->app_name."', ";
|
$sql .= "'".$this->app_name."', ";
|
||||||
@@ -1608,7 +1610,7 @@ include "root.php";
|
|||||||
$sql .= "database_transaction_uuid, ";
|
$sql .= "database_transaction_uuid, ";
|
||||||
$sql .= "domain_uuid, ";
|
$sql .= "domain_uuid, ";
|
||||||
$sql .= "user_uuid, ";
|
$sql .= "user_uuid, ";
|
||||||
if (isset($this->app_uuid)) {
|
if (strlen($this->app_uuid) > 0) {
|
||||||
$sql .= "app_uuid, ";
|
$sql .= "app_uuid, ";
|
||||||
}
|
}
|
||||||
$sql .= "app_name, ";
|
$sql .= "app_name, ";
|
||||||
@@ -1625,7 +1627,7 @@ include "root.php";
|
|||||||
$sql .= "'".uuid()."', ";
|
$sql .= "'".uuid()."', ";
|
||||||
$sql .= "'".$domain_uuid."', ";
|
$sql .= "'".$domain_uuid."', ";
|
||||||
$sql .= "'".$_SESSION['user_uuid']."', ";
|
$sql .= "'".$_SESSION['user_uuid']."', ";
|
||||||
if (isset($this->app_uuid)) {
|
if (strlen($this->app_uuid) > 0) {
|
||||||
$sql .= "'".$this->app_uuid."', ";
|
$sql .= "'".$this->app_uuid."', ";
|
||||||
}
|
}
|
||||||
$sql .= "'".$this->app_name."', ";
|
$sql .= "'".$this->app_name."', ";
|
||||||
|
|||||||
Reference in New Issue
Block a user