]> git.wh0rd.org Git - tt-rss.git/commitdiff
only pass port to mysqli_connect when it is set
authorAndrew Dolgov <fox@fakecake.org>
Fri, 19 Apr 2013 03:58:27 +0000 (07:58 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Fri, 19 Apr 2013 03:58:27 +0000 (07:58 +0400)
classes/db/mysqli.php

index e82f6630007fed0f211c00c20fff1bbb84e955b1..550df6f154cf58070d637a0c14152b92781e5cac 100644 (file)
@@ -3,7 +3,10 @@ class Db_Mysqli implements IDb {
        private $link;
 
        function connect($host, $user, $pass, $db, $port) {
-               $this->link = mysqli_connect($host, $user, $pass, $db, $port);
+               if ($port)
+                       $this->link = mysqli_connect($host, $user, $pass, $db, $port);
+               else
+                       $this->link = mysqli_connect($host, $user, $pass, $db);
 
                if ($this->link) {
                        $this->init();