Merged in bugfix/PMC-337 (pull request #6736)

PMC-337

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2019-01-08 16:04:30 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 77 additions and 65 deletions

View File

@@ -253,14 +253,7 @@ class Net
break;
case 'mssql':
//todo
if (!extension_loaded('sqlsrv')) {
if ($this->db_instance != "") {
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
} else {
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
}
} else {
if (extension_loaded('sqlsrv')) {
if ($this->db_instance != "") {
$server = $this->ip . "\\" . $this->db_instance;
} else {
@@ -274,6 +267,13 @@ class Net
'Database' => $this->db_sourcename
];
$link = @sqlsrv_connect($server, $opt);
} else {
if ($this->db_instance != "") {
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
} else {
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
}
}
if ($link) {
@@ -397,14 +397,7 @@ class Net
}
break;
case 'mssql':
if (!extension_loaded('sqlsrv')) {
if ($this->db_instance != "") {
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
} else {
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
}
} else {
if (extension_loaded('sqlsrv')) {
if ($this->db_instance != "") {
$server = $this->ip . "\\" . $this->db_instance;
} else {
@@ -418,6 +411,13 @@ class Net
'Database' => $this->db_sourcename
];
$link = $db = @sqlsrv_connect($server, $opt);
} else {
if ($this->db_instance != "") {
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
} else {
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
}
}
if ($link) {
if (!extension_loaded('sqlsrv')) {