From 84341fcd6e55e38dd70bd933b9ba7b2656aa9a9b Mon Sep 17 00:00:00 2001 From: Ruan Date: Thu, 9 Jul 2015 14:07:56 +0200 Subject: [PATCH] Add null check for history lookups --- bans.php | 15 ++++++++------- includes/page.php | 2 +- mutes.php | 15 ++++++++------- warnings.php | 12 +++++++----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/bans.php b/bans.php index d0290ab..4116afd 100644 --- a/bans.php +++ b/bans.php @@ -13,22 +13,23 @@ global $table_bans, $conn, $show_inactive_bans; $result = run_query($table_bans); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $timeResult = millis_to_date($row['time']); - $expiresResult = millis_to_date($row['until']); + $player_name = get_name($row['uuid']); + if ($player_name === null) continue; + $until = millis_to_date($row['until']); ?> - + - + diff --git a/includes/page.php b/includes/page.php index 45a44df..e93867b 100644 --- a/includes/page.php +++ b/includes/page.php @@ -101,7 +101,7 @@ function print_check_form($table) {
-
+

'); } diff --git a/mutes.php b/mutes.php index 5d0f5b1..9ce21db 100644 --- a/mutes.php +++ b/mutes.php @@ -12,22 +12,23 @@ global $table_mutes, $conn, $show_inactive_bans; $result = run_query($table_mutes); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $timeResult = millis_to_date($row['time']); - $expiresResult = millis_to_date($row['until']); + $player_name = get_name($row['uuid']); + if ($player_name === null) continue; + $until = millis_to_date($row['until']); ?> - + - + diff --git a/warnings.php b/warnings.php index a9c8a65..0b6430e 100644 --- a/warnings.php +++ b/warnings.php @@ -12,20 +12,22 @@ global $table_warnings, $conn, $show_inactive_bans; $result = run_query($table_warnings); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $expiresResult = millis_to_date($row['until']); + $player_name = get_name($row['uuid']); + if ($player_name === null) continue; + $until = millis_to_date($row['until']); ?> - +