aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_interfaces_suppress_edit.php
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2013-06-18 18:46:51 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2013-06-18 18:46:51 -0400
commit469ed2647ad8b373b15cffc2917def5f90b13e53 (patch)
treeeb031ebb0f3a738026a0d36749cf4980f1550809 /config/snort/snort_interfaces_suppress_edit.php
parent06b1d1718f17c915600585cb2c21c37388e338b1 (diff)
downloadpfsense-packages-469ed2647ad8b373b15cffc2917def5f90b13e53.tar.gz
pfsense-packages-469ed2647ad8b373b15cffc2917def5f90b13e53.tar.bz2
pfsense-packages-469ed2647ad8b373b15cffc2917def5f90b13e53.zip
Remove any zero-length spaces in data when saving.
Diffstat (limited to 'config/snort/snort_interfaces_suppress_edit.php')
-rw-r--r--config/snort/snort_interfaces_suppress_edit.php51
1 files changed, 22 insertions, 29 deletions
diff --git a/config/snort/snort_interfaces_suppress_edit.php b/config/snort/snort_interfaces_suppress_edit.php
index 5e12f656..1eb16260 100644
--- a/config/snort/snort_interfaces_suppress_edit.php
+++ b/config/snort/snort_interfaces_suppress_edit.php
@@ -52,7 +52,6 @@ $id = $_GET['id'];
if (isset($_POST['id']))
$id = $_POST['id'];
-
/* returns true if $name is a valid name for a whitelist file name or ip */
function is_validwhitelistname($name) {
if (!is_string($name))
@@ -70,8 +69,10 @@ if (isset($id) && $a_suppress[$id]) {
$pconfig['name'] = $a_suppress[$id]['name'];
$pconfig['uuid'] = $a_suppress[$id]['uuid'];
$pconfig['descr'] = $a_suppress[$id]['descr'];
- if (!empty($a_suppress[$id]['suppresspassthru']));
+ if (!empty($a_suppress[$id]['suppresspassthru'])) {
$pconfig['suppresspassthru'] = base64_decode($a_suppress[$id]['suppresspassthru']);
+ $pconfig['suppresspassthru'] = str_replace("&#8203;", "", $pconfig['suppresspassthru']);
+ }
if (empty($a_suppress[$id]['uuid']))
$pconfig['uuid'] = uniqid();
}
@@ -107,8 +108,10 @@ if ($_POST['submit']) {
$s_list['name'] = $_POST['name'];
$s_list['uuid'] = uniqid();
$s_list['descr'] = mb_convert_encoding($_POST['descr'],"HTML-ENTITIES","auto");
- if ($_POST['suppresspassthru'])
+ if ($_POST['suppresspassthru']) {
+ $s_list['suppresspassthru'] = str_replace("&#8203;", "", $s_list['suppresspassthru']);
$s_list['suppresspassthru'] = base64_encode($_POST['suppresspassthru']);
+ }
if (isset($id) && $a_suppress[$id])
$a_suppress[$id] = $s_list;
@@ -162,7 +165,7 @@ if ($savemsg)
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?php echo gettext("Name"); ?></td>
- <td width="78%" class="vtable"><input name="name" type="text" id="name"
+ <td width="78%" class="vtable"><input name="name" type="text" id="name"
class="formfld unkown" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /> <br />
<span class="vexpl"> <?php echo gettext("The list name may only consist of the " .
"characters \"a-z, A-Z, 0-9 and _\"."); ?>&nbsp;&nbsp;<span class="red"><?php echo gettext("Note:"); ?> </span>
@@ -170,52 +173,42 @@ if ($savemsg)
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?php echo gettext("Description"); ?></td>
- <td width="78%" class="vtable"><input name="descr" type="text"
+ <td width="78%" class="vtable"><input name="descr" type="text"
class="formfld unkown" id="descr" size="40" value="<?=$pconfig['descr'];?>" /> <br />
<span class="vexpl"> <?php echo gettext("You may enter a description here for your " .
"reference (not parsed)."); ?> </span></td>
</tr>
<tr>
- <td colspan="2">
- <div style='background-color: #E0E0E0' id='redbox'>
- <table width='100%'>
- <tr>
- <td width='8%'>&nbsp;&nbsp;&nbsp;</td>
- <td width='70%'><font size="2" color='#FF850A'><b><?php echo gettext("NOTE:"); ?></b></font>
- <font color='#000000'>&nbsp;&nbsp;<?php echo gettext("The threshold keyword " .
+ <td colspan="2" align="center" height="30px">
+ <font size="2"><span class="red"><strong><?php echo gettext("NOTE:"); ?></strong></span></font>
+ <font color='#000000'>&nbsp;<?php echo gettext("The threshold keyword " .
"is deprecated as of version 2.8.5. Use the event_filter keyword " .
- "instead."); ?></font></td>
- </tr>
- </table>
- </div>
+ "instead."); ?></font>
</td>
</tr>
<tr>
<td colspan="2" valign="top" class="listtopic"><?php echo gettext("Apply suppression or " .
- "filters to rules. Valid keywords are 'suppress', 'event_filter' and " .
- "'rate_filter'."); ?></td>
+ "filters to rules. Valid keywords are 'suppress', 'event_filter' and 'rate_filter'."); ?></td>
</tr>
<tr>
<td colspan="2" valign="top" class="vncell"><b><?php echo gettext("Example 1;"); ?></b>
- suppress gen_id 1, sig_id 1852, track by_src, ip 10.1.1.54<br>
+ suppress gen_id 1, sig_id 1852, track by_src, ip 10.1.1.54<br/>
<b><?php echo gettext("Example 2;"); ?></b> event_filter gen_id 1, sig_id 1851, type limit,
- track by_src, count 1, seconds 60<br>
+ track by_src, count 1, seconds 60<br/>
<b><?php echo gettext("Example 3;"); ?></b> rate_filter gen_id 135, sig_id 1, track by_src,
count 100, seconds 1, new_action log, timeout 10</td>
</tr>
<tr>
- <td width="10%" class="vncell">&nbsp;<?php echo gettext("Advanced pass through"); ?></td>
- <td width="100%" class="vtable"><textarea wrap="off"
- name="suppresspassthru" cols="90" rows="28" id="suppresspassthru" class="formpre"><?=htmlspecialchars($pconfig['suppresspassthru']);?></textarea>
+ <td colspan="2" class="vtable"><textarea wrap="off" style="width:100%; height:100%;"
+ name="suppresspassthru" cols="90" rows="26" id="suppresspassthru" class="formpre"><?=htmlspecialchars($pconfig['suppresspassthru']);?></textarea>
</td>
</tr>
<tr>
- <td width="22%">&nbsp</td>
- <td width="78%"><input id="submit" name="submit" type="submit"
- class="formbtn" value="Save" /> <input id="cancelbutton"
- name="cancelbutton" type="button" class="formbtn" value="Cancel"
- onclick="history.back()" /> <?php if (isset($id) && $a_suppress[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" /> <?php endif; ?>
+ <td colspan="2"><input id="submit" name="submit" type="submit"
+ class="formbtn" value="Save" />&nbsp;&nbsp;<input id="cancelbutton"
+ name="cancelbutton" type="button" class="formbtn" value="Cancel"
+ onclick="history.back();"/> <?php if (isset($id) && $a_suppress[$id]): ?>
+ <input name="id" type="hidden" value="<?=$id;?>"/> <?php endif; ?>
</td>
</tr>
</table>