Skip to content

Commit

Permalink
Fixes for strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Mar 21, 2017
1 parent 3f98605 commit 8b0ea48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check_fighters.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
// The Kabal Invasion - A web-based 4X space game
// Copyright © 2014 The Kabal Invasion development team, Ron Harwood, and the BNT development team
//
Expand All @@ -23,7 +23,7 @@
// Get sectorinfo from database
$sql = "SELECT * FROM ::prefix::universe WHERE sector_id=:sector_id LIMIT 1";
$stmt = $pdo_db->prepare($sql);
$stmt->bindParam(':sector_id', $sector);
$stmt->bindParam(':sector_id', $sector, PDO::PARAM_INT);
$stmt->execute();
$sectorinfo = $stmt->fetch(PDO::FETCH_ASSOC);

Expand All @@ -38,7 +38,7 @@
// Detect if this variable exists, and filter it. Returns false if anything wasn't right.
$response = null;
$response = filter_input(INPUT_POST, 'response', FILTER_SANITIZE_STRING);
if (mb_strlen(trim($response)) === 0)
if (($response === null) || (mb_strlen(trim($response)) === 0))
{
$response = false;
}
Expand Down

0 comments on commit 8b0ea48

Please sign in to comment.