Skip to content

Commit

Permalink
Fix PHP 8.0 fatal error in array sort in plugin log
Browse files Browse the repository at this point in the history
```
[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
```
  • Loading branch information
Deltik committed Nov 30, 2020
1 parent 05dbdb8 commit 28ae487
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions e107_plugins/log/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ function renderNav($action)
function arraySort($array, $column, $order = SORT_DESC)
{
$i=0;
$sortarr = array();
foreach($array as $info)
{
$sortarr[]=$info[$column];
Expand Down

0 comments on commit 28ae487

Please sign in to comment.