Skip to content

Commit e17ebdd

Browse files
committed
Fix sqlsrv default port connection refuse
~ ignore default port when constructr hostname for sqlsrv driver
1 parent 1e7204b commit e17ebdd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Database/SQLSRV/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function connect(bool $persistent = false)
121121
unset($connection['UID'], $connection['PWD']);
122122
}
123123

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

0 commit comments

Comments
 (0)