From 12d375c099b2050fe8bd4cbdbb065c67ee7643eb Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Mon, 6 Apr 2020 20:22:43 -0500 Subject: [PATCH] Fixes "Invalid argument supplied for foreach()" Type casts each input array for each to avoid invalid argument error --- templates/settings-admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index f9885f74..592e1641 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -63,7 +63,7 @@ function FormatBytes($byte) { $cpu_name_output = []; $splitted_cpu_name = explode(PHP_EOL, $_['cpu']); if (sizeof($splitted_cpu_name) > 0): - foreach ($splitted_cpu_name as $cpu_name_part): + foreach ((array) $splitted_cpu_name as $cpu_name_part): if (!in_array($cpu_name_part, $cpu_name_output)): if (!is_numeric($cpu_name_part)): $cpu_name_output[] = $cpu_name_part; @@ -135,7 +135,7 @@ function FormatBytes($byte) { t('Disk')); ?> - +
@@ -194,7 +194,7 @@ function FormatBytes($byte) {
- +