Minor edit add a few spaces.

This commit is contained in:
FusionPBX
2022-09-18 02:59:58 -06:00
committed by GitHub
parent 7c2017bd03
commit d5bd5957a4
+8 -8
View File
@@ -264,7 +264,7 @@ include "root.php";
$this->app_name = self::sanitize($value); $this->app_name = self::sanitize($value);
break; break;
case 'message': case 'message':
if(is_array($value)) { if (is_array($value)) {
$this->message = $value; $this->message = $value;
} else { } else {
trigger_error('Message property must be set to array type', E_USER_ERROR); trigger_error('Message property must be set to array type', E_USER_ERROR);
@@ -277,7 +277,7 @@ include "root.php";
$this->db_name = self::sanitize($value); $this->db_name = self::sanitize($value);
break; break;
case 'db': case 'db':
if($name instanceof PDO) { if ($name instanceof PDO) {
$this->db = $value; $this->db = $value;
} else { } else {
trigger_error('db property must be a PDO object!', E_USER_ERROR); trigger_error('db property must be a PDO object!', E_USER_ERROR);
@@ -287,26 +287,26 @@ include "root.php";
break; break;
case 'path': case 'path':
$value = realpath($value); $value = realpath($value);
if(file_exists($value)) { if (file_exists($value)) {
$this->path = $value; $this->path = $value;
} else { } else {
trigger_error('Unable to find database path file!', E_USER_ERROR); trigger_error('Unable to find database path file!', E_USER_ERROR);
} }
break; break;
case 'db_cert_authority': case 'db_cert_authority':
if(!file_exists($value)) { if (!file_exists($value)) {
trigger_error('db cert authority not found!', E_USER_WARNING); trigger_error('db cert authority not found!', E_USER_WARNING);
} }
$this->db_cert_authority = $value; $this->db_cert_authority = $value;
break; break;
case 'port': case 'port':
$value = (int)$value; // force cast to int $value = (int)$value; // force cast to int
if($value > 1023 && $value < 65536) { $this->port = $value; } //valid values are 1024...65535 if ($value > 1023 && $value < 65536) { $this->port = $value; } //valid values are 1024...65535
else { trigger_error('Port not a valid range', E_USER_ERROR); } else { trigger_error('Port not a valid range', E_USER_ERROR); }
break; break;
case 'app_uuid': case 'app_uuid':
case 'domain_uuid': case 'domain_uuid':
if(is_uuid($value)) { $this->domain_uuid = $value; } if (is_uuid($value)) { $this->domain_uuid = $value; }
else { trigger_error('Domain or App UUID not valid', E_USER_ERROR); } else { trigger_error('Domain or App UUID not valid', E_USER_ERROR); }
break; break;
case 'type': case 'type':
@@ -325,7 +325,7 @@ include "root.php";
} }
case 'offset': case 'offset':
case 'limit': case 'limit':
if(is_int($value)) { if (is_int($value)) {
$this->$name = $value; $this->$name = $value;
} else { } else {
trigger_error('Offset or Limit not set to valid integer. Resetting to zero!', E_USER_WARNING); trigger_error('Offset or Limit not set to valid integer. Resetting to zero!', E_USER_WARNING);
@@ -648,7 +648,7 @@ include "root.php";
* @depends connect() * @depends connect()
*/ */
public function table_exists ($table_name) : bool { public function table_exists ($table_name) : bool {
if(self::sanitize($table_name) != $table_name) { if (self::sanitize($table_name) != $table_name) {
trigger_error('Table Name must be sanitized', E_USER_WARNING); trigger_error('Table Name must be sanitized', E_USER_WARNING);
return false; return false;
} }