From bfc7a2b28a67c04eae9d5881a9c069ceadd13914 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Fri, 17 Nov 2017 23:18:40 +0100 Subject: [PATCH] fix: keeping compatibility with older versions #353 --- GameEngine/Admin/database.php | 2 +- GameEngine/Database.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Admin/database.php b/GameEngine/Admin/database.php index 95af5f15..aac61d10 100755 --- a/GameEngine/Admin/database.php +++ b/GameEngine/Admin/database.php @@ -48,7 +48,7 @@ class adm_DB { var $connection; function __construct(){ global $database; - $database = new MYSQLi_DB(SQL_SERVER.':'.SQL_PORT, SQL_USER, SQL_PASS, SQL_DB); + $database = new MYSQLi_DB(SQL_SERVER.':'.(defined('SQL_PORT') ? SQL_PORT : 3306), SQL_USER, SQL_PASS, SQL_DB); $this->connection = $database->return_link(); } diff --git a/GameEngine/Database.php b/GameEngine/Database.php index cc77da7d..7affb0c5 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -6812,7 +6812,7 @@ References: // database is not needed if we're displaying static pages $req_file = basename($_SERVER['PHP_SELF']); if (!in_array($req_file, ['tutorial.php', 'anleitung.php'])) { - $database = new MYSQLi_DB(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB, SQL_PORT); + $database = new MYSQLi_DB(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB, (defined('SQL_PORT') ? SQL_PORT : 3306)); $link = $database->return_link(); $GLOBALS['db'] = $database; $GLOBALS['link'] = $database->return_link();