aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTigersharke <tigersharke@gmail.com>2012-11-21 03:33:44 +0000
committerTigersharke <tigersharke@gmail.com>2012-11-21 03:33:44 +0000
commit81f6a4d63d9766712cc3e5693d899d7405030f96 (patch)
tree9474d91d249c191f66d90729ac538a279aac65f8
parent255d993832f2c7a3b0ea523a98da05f6e77f7fde (diff)
downloadpfsense-packages-81f6a4d63d9766712cc3e5693d899d7405030f96.tar.gz
pfsense-packages-81f6a4d63d9766712cc3e5693d899d7405030f96.tar.bz2
pfsense-packages-81f6a4d63d9766712cc3e5693d899d7405030f96.zip
As suggested, test moved ahead of first instance array is used.
The first 'for each' in sksort is where the error presents.
-rw-r--r--config/widget-snort/snort_alerts.widget.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/config/widget-snort/snort_alerts.widget.php b/config/widget-snort/snort_alerts.widget.php
index b7b60a07..bb51a387 100644
--- a/config/widget-snort/snort_alerts.widget.php
+++ b/config/widget-snort/snort_alerts.widget.php
@@ -29,14 +29,14 @@ global $config, $g;
/* array sorting */
function sksort(&$array, $subkey="id", $sort_ascending=false) {
- if (count($array)) {
- $temp_array[key($array)] = array_shift($array);
- };
/* an empty array causes sksort to fail - this test alleviates the error */
if(empty($array))
{
return false;
}
+ if (count($array)) {
+ $temp_array[key($array)] = array_shift($array);
+ };
foreach ($array as $key => $val){
$offset = 0;
$found = false;