Skip to content

Commit

Permalink
Fix sqlsrv default port connection refuse
Browse files Browse the repository at this point in the history
~ ignore default port when constructr hostname for sqlsrv driver
  • Loading branch information
puschie286 committed Jun 26, 2023
1 parent 1e7204b commit e17ebdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function connect(bool $persistent = false)
unset($connection['UID'], $connection['PWD']);
}

if (strpos($this->hostname, ',') === false && $this->port !== '') {
if (strpos($this->hostname, ',') === false && $this->port !== '' && (int)$this->port !== 1433) {
$this->hostname .= ', ' . $this->port;
}

Expand Down

0 comments on commit e17ebdd

Please sign in to comment.