Skip to content
Snippets Groups Projects
Commit a910ac6b authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed empty array error

parent 6fc1b94a
No related branches found
No related tags found
2 merge requests!1895Development,!1790Development
...@@ -111,12 +111,13 @@ class AdminSpamController extends Controller ...@@ -111,12 +111,13 @@ class AdminSpamController extends Controller
if (file_exists($file)) { if (file_exists($file)) {
$tmpBans = json_decode(file_get_contents($file), true); $tmpBans = json_decode(file_get_contents($file), true);
if(!empty($tmpBans) && is_array($tmpBans)){
foreach ($tmpBans as $ban) { foreach ($tmpBans as $ban) {
#dd($ban["banned-until"]); #dd($ban["banned-until"]);
$bannedUntil = Carbon::createFromFormat('Y-m-d H:i:s', $ban["banned-until"]); $bannedUntil = Carbon::createFromFormat('Y-m-d H:i:s', $ban["banned-until"]);
if ($bannedUntil->isAfter(Carbon::now())) { if ($bannedUntil->isAfter(Carbon::now())) {
$bans[] = $ban; $bans[] = $ban;
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment