From 25982f04756beef6677afbda06113f08d3521a5d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 24 Oct 2016 18:55:11 -0700 Subject: set port if non-zero (instead of non-null) --- include/dba/dba_driver.php | 2 +- include/dba/dba_pdo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/dba') diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index afe209feb..8ae3dccfe 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -73,7 +73,7 @@ class DBA { $dsn = $server; } else { - $dsn = self::$scheme . ':host=' . $server . (is_null($port) ? '' : ';port=' . $port); + $dsn = self::$scheme . ':host=' . $server . (intval($port) ? '' : ';port=' . $port); } $dsn .= ';dbname=' . $db; diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php index b247728ff..1d0b142aa 100755 --- a/include/dba/dba_pdo.php +++ b/include/dba/dba_pdo.php @@ -15,7 +15,7 @@ class dba_pdo extends dba_driver { $dsn = $server; } else { - $dsn = $this->driver_dbtype . ':host=' . $server . (is_null($port) ? '' : ';port=' . $port); + $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? '' : ';port=' . $port); } $dsn .= ';dbname=' . $db; -- cgit v1.2.3