]> git.wh0rd.org - tt-rss.git/blobdiff - install/index.php
Fixing bugs found by static analysis
[tt-rss.git] / install / index.php
index 416765e8f7caceedede06dc7fb9164631045445e..6cb2ace4f370c8b5e0788354c5fd9a66b5e04893 100644 (file)
@@ -89,7 +89,7 @@
                        <span><img src=\"../images/sign_info.svg\"></span><span>$msg</span></div>";
        }
 
-       function db_connect($host, $user, $pass, $db, $type, $port) {
+       function db_connect($host, $user, $pass, $db, $type, $port = false) {
                if ($type == "pgsql") {
 
                        $string = "dbname=$db user=$user";
 
                } else if ($type == "mysql") {
                        if (function_exists("mysqli_connect")) {
-                               return mysqli_connect($host, $user, $pass, $db, $port);
+                               if ($port)
+                                       return mysqli_connect($host, $user, $pass, $db, $port);
+                               else
+                                       return mysqli_connect($host, $user, $pass, $db);
 
                        } else {
                                $link = mysql_connect($host, $user, $pass);