]> git.wh0rd.org - tt-rss.git/commitdiff
pdo connection string: properly check for DB_PORT
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 10:37:43 +0000 (13:37 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 10:37:43 +0000 (13:37 +0300)
classes/db.php

index aba249a50b6779759a2b72fbb8648f7a08c8cc50..1a4d0b2eee86e2efd352746a09e3bd3d75343265 100644 (file)
@@ -25,7 +25,7 @@ class Db implements IDb {
                        exit(100);
                }
 
-               $db_port = defined(DB_PORT) ? ';port='.DB_PORT : '';
+               $db_port = defined('DB_PORT') && DB_PORT ? ';port='.DB_PORT : '';
 
                $this->pdo = new PDO(DB_TYPE . ':dbname='.DB_NAME.';host='.DB_HOST.$db_port,
                        DB_USER,