index 702ccdb30a8130fcc19f82e02617917665a64575..99f170df244e134473815505e191704b24f9c672 100644 (file)
function sieve_if($elements,$object_id,$parent)
{
$this->parent = $parent;
+ $this->object_id = $object_id;
/* Possible address parts we can select */
$this->address_parts = array(
"gt" => _("greater than"),
"ne" => _("not equal"));
- $this->object_id = $object_id;
- if($elements!=NULL){
- $this->elements = $elements;
- $this->_parsed = $this->_parse($elements['ELEMENTS'],1);
+ /* Skip parsing if this element is new */
+ if($elements != NULL){
+
+ /* Remove comments from tests */
+ $tmp = array();
+ foreach($elements['ELEMENTS'] as $ele){
+ if($ele['class'] != "comment"){
+ $tmp[] = $ele;
+ }
+ }
+ $elements['ELEMENTS'] = $tmp;
+
+ if($elements!=NULL){
+ $this->elements = $elements;
+ $this->_parsed = $this->_parse($elements['ELEMENTS'],1);
+ }
}
}
if(!isset($match_types[$mt])){
$parsed[$key]['LastError'] = _("Invalid match type given.");
}
+ if($mt == ":regex"){
+ $this->parent->add_require("regex");
+ }
$parsed[$key]['Match_type'] = $mt;
}
$Match_types = array( ":over" => _("greater than") ,
":under" => _("lower than"));
- $Units = array( "M" => _("Megabyte") ,
- "K" => _("Kilobyte"));
+ $Units = array( "M" => _("Megabyte"),
+ "K" => _("Kilobyte"),
+ "" => _("Bytes"));
/* Toggle Inverse ? */
if(isset($_POST['toggle_inverse_'.$element_id])){
$Match_types = array( ":over" => _("greater than") ,
":under" => _("lower than"));
- $Units = array( "M" => _("Megabyte") ,
- "K" => _("Kilobyte"));
+ $Units = array( "M" => _("Megabyte"),
+ "K" => _("Kilobyte"),
+ "" => _("Bytes"));
$Match_type = $data['Match_type'];
$Value = preg_replace("/[^0-9]/","",$data['Value_List'][0]);