diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-09 22:02:44 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-09 22:02:44 +0000 |
commit | 35eef977565cc91dcbeea94c2ed4bd7b55aefd0d (patch) | |
tree | 4a156937341c3fc57b112e59e24abfb1651f0d9d /usr/local/www | |
parent | 6ad262495fa27f3529a54612f135a6ca1311f4e0 (diff) | |
download | pfsense-35eef977565cc91dcbeea94c2ed4bd7b55aefd0d.zip pfsense-35eef977565cc91dcbeea94c2ed4bd7b55aefd0d.tar.gz |
Do not foreach item unless its an array
Ticket #865
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/fbegin.inc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 035a98d..d2d389c 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -51,23 +51,25 @@ require_once("notices.inc"); if(is_array($requests)) $request_string = implode("&", $requests); - foreach ($notices as $key => $value) { - $date = date("m-d-y H:i:s", $key); - $noticemsg = str_replace("'", "", $value['notice']); - $noticemsg = str_replace('"', "", $noticemsg); - $noticemsg = str_replace("\n", "", $noticemsg); - $noticemsg = str_replace("<p>", "", $noticemsg); - $noticemsg = str_replace("<pre>", "", $noticemsg); - $noticemsg = str_replace("</pre>", "", $noticemsg); - $noticemsg = str_replace("</p>", "", $noticemsg); - $noticemsg = str_replace("<br>", "", $noticemsg); - $notice_msgs = '<a href="?noticeaction=acknowledge¬iceid=all">Acknowledge All</a> .:. '; - if ($value['url']) { - $notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']</a>'; - } else { - $notice_msgs .= $date.' - <a href="?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>'; + if(is_array($notices)) { + foreach ($notices as $key => $value) { + $date = date("m-d-y H:i:s", $key); + $noticemsg = str_replace("'", "", $value['notice']); + $noticemsg = str_replace('"', "", $noticemsg); + $noticemsg = str_replace("\n", "", $noticemsg); + $noticemsg = str_replace("<p>", "", $noticemsg); + $noticemsg = str_replace("<pre>", "", $noticemsg); + $noticemsg = str_replace("</pre>", "", $noticemsg); + $noticemsg = str_replace("</p>", "", $noticemsg); + $noticemsg = str_replace("<br>", "", $noticemsg); + $notice_msgs = '<a href="?noticeaction=acknowledge¬iceid=all">Acknowledge All</a> .:. '; + if ($value['url']) { + $notice_msgs .= $date.' - <a href="'.$url.'?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']</a>'; + } else { + $notice_msgs .= $date.' - <a href="?'.$request_string.'¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']'.$noticemsg.'</a>'; + } + $notice_msgs .= " .:. "; } - $notice_msgs .= " .:. "; } ?> <div id="alerts"> |