From bf5eae394fe6bc39e7f4ab930fc6d686cb9f0854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristi=C3=A1n=20Partl?= Date: Thu, 5 May 2022 18:45:26 +0200 Subject: [PATCH] PHP Warning: Undefined array key "history" in lgsl_class.php on line 268 --- lgsl_files/lgsl_class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsl_files/lgsl_class.php b/lgsl_files/lgsl_class.php index 90c81cf..93f03db 100644 --- a/lgsl_files/lgsl_class.php +++ b/lgsl_files/lgsl_class.php @@ -263,14 +263,14 @@ function lgsl_query_cached($type, $ip, $c_port, $q_port, $s_port, $request, $id if(time() - $item['time'] < 60 * 60 * 24) // NOT OLDER THAN 1 DAY array_push($live['s']['history'], $item); } - } - $last = ($cache['s']['history'] ? end($cache['s']['history']) : null); - if(!$last or time() - $last['time'] >= 60 * 15 ) { // RECORD IF 15 MINS IS PASSED - array_push($live['s']['history'], array( - "status" => (int) $live['b']['status'], - "time" => $live['s']['cache_time'], - "players" => (int) $live['s']['players'] - )); + $last = ($cache['s']['history'] ? end($cache['s']['history']) : null); + if(!$last or time() - $last['time'] >= 60 * 15 ) { // RECORD IF 15 MINS IS PASSED + array_push($live['s']['history'], array( + "status" => (int) $live['b']['status'], + "time" => $live['s']['cache_time'], + "players" => (int) $live['s']['players'] + )); + } } }