Actions
Bug #2679
closedPHP warnings in diag_states_summary.php
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=...").
Updated by Ermal Luçi about 12 years ago
I would suggest you to use github for such fixes.
It makes it a lot easier to commit and review patches.
Redmine is useful for tracking an issue.
You have both the issue/analysis/fix so github helps here.
Updated by Ermal Luçi about 12 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 3f00208a0851ab37626a1ca39a644846964f6c18.
Updated by Thomas NOEL about 12 years ago
I think there is an error in the commited patch : "if (!portarr)" instead of "if (!$portarr)"
(and yes, I start use github asap)
Updated by Ermal Luçi about 12 years ago
Applied in changeset 69fec196d4f2a56c3390769c98e56ce4da292069.
Updated by Renato Botelho over 10 years ago
- Status changed from Feedback to Resolved
Actions