From: hickert Date: Thu, 22 Mar 2007 14:28:14 +0000 (+0000) Subject: Updated to regex support X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c8e88e997402e4906104cd66cd8e22157209d87f;p=gosa.git Updated to regex support Size allows Byte now. require "Regex" will be added automatically now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5865 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_sieveElement_If.inc b/include/sieve/class_sieveElement_If.inc index 702ccdb30..56a25b385 100644 --- a/include/sieve/class_sieveElement_If.inc +++ b/include/sieve/class_sieveElement_If.inc @@ -585,6 +585,9 @@ class sieve_if 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; } @@ -694,8 +697,9 @@ class sieve_if $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])){ @@ -1030,8 +1034,9 @@ class sieve_if $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]); diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index dff33d0fe..5c963d584 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -889,7 +889,7 @@ class sieveManagement extends plugin foreach($this->scripts as $key => $script){ if($script['EDITED']){ $data = $this->scripts[$key]['SCRIPT']; - if(!$this->sieve_handle->sieve_sendscript($script['NAME'], $data)){ + if(!$this->sieve_handle->sieve_sendscript($script['NAME'], addcslashes ($data,"\\"))){ gosa_log("Failed to save sieve script named '".$script['NAME']."': ".to_string($this->sieve_handle->error_raw)); $everything_went_fine = FALSE; print_red(to_string($this->sieve_handle->error_raw));