From d0e3555d5741960af91a0ebe504faddc31bea381 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 5 Sep 2011 07:34:52 +0000 Subject: Add function in case it is not declared so the editing works correctly --- config/snort/snort_rules_edit.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/snort/snort_rules_edit.php b/config/snort/snort_rules_edit.php index 266750fa..330630f4 100644 --- a/config/snort/snort_rules_edit.php +++ b/config/snort/snort_rules_edit.php @@ -86,6 +86,16 @@ if (strstr($splitcontents[$lineid], $findme)) if ($highlight == "no") $splitcontents[$lineid] = substr($splitcontents[$lineid], 2); +if (!function_exists('get_middle')) { + function get_middle($source, $beginning, $ending, $init_pos) { + $beginning_pos = strpos($source, $beginning, $init_pos); + $middle_pos = $beginning_pos + strlen($beginning); + $ending_pos = strpos($source, $ending, $beginning_pos); + $middle = substr($source, $middle_pos, $ending_pos - $middle_pos); + return $middle; + } +} + if ($_POST) { if ($_POST['save']) { -- cgit v1.2.3