Skip to content

Commit

Permalink
Improvements thanks to Scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Sep 20, 2021
1 parent 5abfe8f commit 3b97d6b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function initAdodb(): object
$db_host .= ":$db_port";
}

$old_db = new \stdClass();
// Attempt to connect to the database
try
{
Expand Down Expand Up @@ -107,6 +106,7 @@ public function initAdodb(): object
throw new \Exception($err_msg);
}

$old_db->prefix = null;
$old_db->prefix = $db_prefix;
// End of database work
return $old_db;
Expand Down
1 change: 0 additions & 1 deletion classes/KabalHunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class KabalHunt
public static function hunt(\PDO $pdo_db, string $lang, array $playerinfo, int $kabalisdead, Registry $tkireg): void
{
$langvars = Translate::load($pdo_db, $lang, array('main'));
$targetinfo = array();

$sql = "SELECT COUNT(*) AS num_players FROM ::prefix::ships WHERE ship_destroyed='N' AND email NOT LIKE '%@kabal' AND ship_id > 1";
$stmt = $pdo_db->prepare($sql);
Expand Down
2 changes: 1 addition & 1 deletion classes/KabalToPlanet.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public static function planet(\PDO $pdo_db, string $lang, int $planet_id, Regist
$shiplist = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$i = 0;

if (is_array($shiplist))
if ($shiplist !== false)
{
foreach ($shiplist as $onplanet)
{
Expand Down

0 comments on commit 3b97d6b

Please sign in to comment.