From 68530cf20710a4eefe9cd7b13438ad0585482d04 Mon Sep 17 00:00:00 2001 From: The Kabal Date: Mon, 20 Sep 2021 08:09:04 -0400 Subject: [PATCH] Improvements thanks to Scrutinizer --- classes/PlanetReportCE.php | 4 ++-- classes/Registry.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/PlanetReportCE.php b/classes/PlanetReportCE.php index a212a20e..59b32158 100644 --- a/classes/PlanetReportCE.php +++ b/classes/PlanetReportCE.php @@ -98,14 +98,14 @@ public static function collectCredits(\PDO $pdo_db, string $lang, array $planeta public static function takeCredits(\PDO $pdo_db, string $lang, int $planet_id): string { $langvars = Translate::load($pdo_db, $lang, array('common', 'planet_report', 'regional')); - $playerinfo = array(); - $planetinfo = array(); // Get playerinfo from database + $playerinfo = array(); $players_gateway = new \Tki\Players\PlayersGateway($pdo_db); $playerinfo = $players_gateway->selectPlayerInfo($_SESSION['username']); // Get planetinfo from database + $planetinfo = array(); $sql = "SELECT * FROM ::prefix::planets WHERE planet_id = :planet_id LIMIT 1"; $stmt = $pdo_db->prepare($sql); $sql_test = \Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); diff --git a/classes/Registry.php b/classes/Registry.php index 11d797ae..74cf83c2 100644 --- a/classes/Registry.php +++ b/classes/Registry.php @@ -218,7 +218,7 @@ public function loadFromIni(): void // Which ini file is hard-coded for now // FUTURE: When we get multiple game support, we may need to change it $ini_keys = parse_ini_file('config/classic_config.ini', true, INI_SCANNER_TYPED); - if (is_array($ini_keys)) + if ($ini_keys !== false) { foreach ($ini_keys as $config_line) {