aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-11-29 09:45:13 -0500
committerjim-p <jimp@pfsense.org>2010-11-29 09:45:13 -0500
commitfd1235b89a0e43deb7bc2d3720fe32cfbef8e16c (patch)
tree5c97865630f20c7e04c1ec297b1d0e38f948dc06
parentf7fc1ac41c21e7eb490e06cce5a8bef067b9f282 (diff)
downloadpfsense-packages-fd1235b89a0e43deb7bc2d3720fe32cfbef8e16c.tar.gz
pfsense-packages-fd1235b89a0e43deb7bc2d3720fe32cfbef8e16c.tar.bz2
pfsense-packages-fd1235b89a0e43deb7bc2d3720fe32cfbef8e16c.zip
Test array before foreach
-rw-r--r--config/widget-snort/snort_alerts.widget.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/config/widget-snort/snort_alerts.widget.php b/config/widget-snort/snort_alerts.widget.php
index 9b5b2b64..c2622dc7 100644
--- a/config/widget-snort/snort_alerts.widget.php
+++ b/config/widget-snort/snort_alerts.widget.php
@@ -34,8 +34,10 @@ global $config, $g;
<td width="40%" class="widgetsubheader">Src/Dst</td>
<td width="40%" class="widgetsubheader">Details</td>
</tr>
-<?php $counter=0;
- foreach ($snort_alerts as $alert) { ?>
+<?php
+$counter=0;
+if (is_array($snort_alerts)) {
+ foreach ($snort_alerts as $alert) { ?>
<?php
if(isset($config['syslog']['reverse'])) {
@@ -60,6 +62,7 @@ global $config, $g;
<td width="40%" class="listr"><?= 'Pri : ' . $alert["priority"] . '<br>' . 'Cat : ' . $alert['category'] ?></td>
</tr>
<?php $counter++;
- } ?>
+ }
+} ?>
</tbody>
</table>