From 28ae48783f779e5ac001fa7aee89a5c16e55f663 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Mon, 30 Nov 2020 12:58:06 +0100 Subject: [PATCH] Fix PHP 8.0 fatal error in array sort in plugin log ``` [Mon Nov 30 03:41:56.019794 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag in ~/public_html/e107_plugins/log/stats.php:808 [Mon Nov 30 03:41:56.019853 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: Stack trace: [Mon Nov 30 03:41:56.019861 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: #0 ~/public_html/e107_plugins/log/stats.php(808): array_multisort() [Mon Nov 30 03:41:56.019867 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: #1 ~/public_html/e107_plugins/log/stats.php(1620): siteStats->arraySort() [Mon Nov 30 03:41:56.019885 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: #2 ~/public_html/e107_plugins/log/stats.php(194): siteStats->renderQueries() [Mon Nov 30 03:41:56.019891 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: #3 {main} [Mon Nov 30 03:41:56.019897 2020] [fcgid:warn] [pid 3259290:tid 140500652779264] [client xxx.xxx.xxx.xxx:0] mod_fcgid: stderr: thrown in ~/public_html/e107_plugins/log/stats.php on line 808 ``` --- e107_plugins/log/stats.php | 1 + 1 file changed, 1 insertion(+) diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index e1792508f..c5f15290d 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -800,6 +800,7 @@ class siteStats function arraySort($array, $column, $order = SORT_DESC) { $i=0; + $sortarr = array(); foreach($array as $info) { $sortarr[]=$info[$column];