aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_rules_edit.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2011-08-02 00:26:30 +0200
committerErmal Luçi <eri@pfsense.org>2011-08-02 00:26:30 +0200
commitc8b7c369d1b391fc687e4ad09ee156dbec37043a (patch)
treec2f7ef99c8b82a22077469956e0fac7808a61cb6 /config/snort/snort_rules_edit.php
parent2778501ec22f98415311d2d22eca9515fd1d5d93 (diff)
downloadpfsense-packages-c8b7c369d1b391fc687e4ad09ee156dbec37043a.tar.gz
pfsense-packages-c8b7c369d1b391fc687e4ad09ee156dbec37043a.tar.bz2
pfsense-packages-c8b7c369d1b391fc687e4ad09ee156dbec37043a.zip
First pass of sanitizing this code. Some more QA is needed to make sure what is selected is actually applied behind
Diffstat (limited to 'config/snort/snort_rules_edit.php')
-rw-r--r--config/snort/snort_rules_edit.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/config/snort/snort_rules_edit.php b/config/snort/snort_rules_edit.php
index 09e39e7a..05712e49 100644
--- a/config/snort/snort_rules_edit.php
+++ b/config/snort/snort_rules_edit.php
@@ -49,15 +49,13 @@ $a_nat = &$config['installedpackages']['snortglobal']['rule'];
$id = $_GET['id'];
if (isset($_POST['id']))
-$id = $_POST['id'];
+ $id = $_POST['id'];
$ids = $_GET['ids'];
if (isset($_POST['ids']))
-$ids = $_POST['ids'];
-
+ $ids = $_POST['ids'];
if (isset($id) && $a_nat[$id]) {
-
$pconfig['enable'] = $a_nat[$id]['enable'];
$pconfig['interface'] = $a_nat[$id]['interface'];
$pconfig['rulesets'] = $a_nat[$id]['rulesets'];
@@ -94,6 +92,7 @@ $splitcontents = explode($delimiter, $contents2);
//copy rule contents from array into string
$tempstring = $splitcontents[$lineid];
+if (!function_exists('write_rule_file')) {
function write_rule_file($content_changed, $received_file)
{
//read snort file with writing enabled
@@ -112,6 +111,7 @@ function write_rule_file($content_changed, $received_file)
fclose($filehandle);
}
+}
@@ -127,14 +127,14 @@ if($_POST['highlight'] <> "") {
}
if($_POST['rows'] <> "")
-$rows = $_POST['rows'];
+ $rows = $_POST['rows'];
else
-$rows = 1;
+ $rows = 1;
if($_POST['cols'] <> "")
-$cols = $_POST['cols'];
+ $cols = $_POST['cols'];
else
-$cols = 66;
+ $cols = 66;
if ($_POST)
{
@@ -150,7 +150,7 @@ if ($_POST)
write_rule_file($splitcontents, $file);
header("Location: /snort/snort_view_edit.php?id=$id&openruleset=$file&ids=$ids");
-
+ exit;
}
}