]> git.mxchange.org Git - friendica.git/commitdiff
And better only provide `$port` when larger zero.
authorRoland Häder <roland@mxchange.org>
Sat, 21 Jul 2018 02:32:45 +0000 (04:32 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Jul 2018 14:27:51 +0000 (16:27 +0200)
src/Database/DBA.php

index f5e785955c8c21813a38b2d7b4852bbaee4ff6eb..fa9d86bb0f07e678bccd0aa635b14d9b7aba4fab 100644 (file)
@@ -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;