From: Roland Häder Date: Sat, 21 Jul 2018 02:32:45 +0000 (+0200) Subject: And better only provide `$port` when larger zero. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c96fc8d62293abd40903bb528d822690888e7b85;p=friendica.git And better only provide `$port` when larger zero. --- diff --git a/src/Database/DBA.php b/src/Database/DBA.php index f5e785955c..fa9d86bb0f 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -93,7 +93,13 @@ class DBA if (!self::$connected && class_exists('\mysqli')) { self::$driver = 'mysqli'; - self::$db = @new mysqli($server, $user, $pass, $db, $port); + + if ($port > 0) { + self::$db = @new mysqli($server, $user, $pass, $db, $port); + } else { + self::$db = @new mysqli($server, $user, $pass, $db); + } + if (!mysqli_connect_errno()) { self::$connected = true;