Project

General

Profile

Actions

Bug #2679

closed

PHP warnings in diag_states_summary.php

Added by Thomas NOEL over 11 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/12/2012
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.0.1
Affected Architecture:
All

Description

When there is a lot of clients, there is a lot of these warnings in /tmp/PHP_erros.log :

[12-Nov-2012 12:32:04] PHP Warning:  asort() expects parameter 1 to be array, null given in /usr/local/www/diag_states_summary.php on line 107
[12-Nov-2012 12:32:04] PHP Warning:  array_reverse(): The argument should be an array in /usr/local/www/diag_states_summary.php on line 108
[12-Nov-2012 12:32:04] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/www/diag_states_summary.php on line 108

Here is a patch :

--- a/usr/local/www/diag_states_summary.php
+++ b/usr/local/www/diag_states_summary.php
@@ -103,6 +103,8 @@ function sort_by_ip($a, $b) {
 }

 function build_port_info($portarr, $proto) {
+       if (! $portarr)
+               return '';
        $ports = array();
        asort($portarr);
        foreach (array_reverse($portarr, TRUE) as $port => $count) {

(However, I don't understand why we need this function, because its result is not shown ; it is just used in two "span title=...").

Actions

Also available in: Atom PDF