diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_If.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_If.inc
index cb33ae5e788e2fb09ac9a366613f5d698f026345..4412f3fe6a0a3d86062c8f01f137b9fca633c725 100644 (file)
/* Match types */
$this->match_types = array(
":is" => _("is"),
/* Match types */
$this->match_types = array(
":is" => _("is"),
- ":regex" => _("regex"),
+ ":regex" => _("reg-ex"),
":contains" => _("contains"),
":matches" => _("matches"),
":count" => _("count"),
":contains" => _("contains"),
":matches" => _("matches"),
":count" => _("count"),
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
- if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+ if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
- if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+ if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
$script .= $data['Match_type']." ";
/* Add special match type for count and value */
- if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+ if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
$script .= sieve_create_strings($data['Match_type_value'])." ";
}
"LastError" => "",
"Match_type" => ":contains",
"Match_type_value"=> "",
"LastError" => "",
"Match_type" => ":contains",
"Match_type_value"=> "",
- "Key_List" => array(_("emtpy")),
+ "Key_List" => array(_("empty")),
"Value_List" => array(_("empty"))) ;
if($type == "address"){
$values["Address_Part"] = ":all";
"Value_List" => array(_("empty"))) ;
if($type == "address"){
$values["Address_Part"] = ":all";
$element_id = $this->object_id."_".$id."_".$obj_id;
foreach($_POST as $name => $value){
$element_id = $this->object_id."_".$id."_".$obj_id;
foreach($_POST as $name => $value){
- if(preg_match("/Remove_Test_Object_".$element_id."_(x|y)/",$name)) {
+ if(preg_match("/Remove_Test_Object_".$element_id."/",$name)) {
return(false);
}
}
return(false);
}
}
/* In case of :count and :value match types
* we have a special match operator we should save.
*/
/* In case of :count and :value match types
* we have a special match operator we should save.
*/
- if(in_array($parsed[$key]['Match_type'],array(":value",":count"))){
+ if(in_array_strict($parsed[$key]['Match_type'],array(":value",":count"))){
if(isset($_POST['operator_'.$element_id])){
$op = $_POST['operator_'.$element_id];
if(isset($_POST['operator_'.$element_id])){
$op = $_POST['operator_'.$element_id];
$vls = stripslashes($_POST['keys_'.$element_id]);
$tmp = array();
$vls = stripslashes($_POST['keys_'.$element_id]);
$tmp = array();
- $tmp2 = split(",",$vls);
+ $tmp2 = explode(",",$vls);
foreach($tmp2 as $val){
$tmp[] = trim($val);
foreach($tmp2 as $val){
$tmp[] = trim($val);
$vls = stripslashes($_POST['values_'.$element_id]);
$tmp = array();
$vls = stripslashes($_POST['values_'.$element_id]);
$tmp = array();
- $tmp2 = split(",",$vls);
+ $tmp2 = explode(",",$vls);
foreach($tmp2 as $val){
$tmp[] = trim($val);
if(preg_match("/\"/",$val)){
foreach($tmp2 as $val){
$tmp[] = trim($val);
if(preg_match("/\"/",$val)){
$vls = stripslashes($_POST['Values_'.$element_id]);
$tmp = array();
$vls = stripslashes($_POST['Values_'.$element_id]);
$tmp = array();
- $tmp2 = split(",",$vls);
+ $tmp2 = explode(",",$vls);
foreach($tmp2 as $val){
$tmp[] = "\"".trim(preg_replace("/\"/","",$val))."\"";
}
foreach($tmp2 as $val){
$tmp[] = "\"".trim(preg_replace("/\"/","",$val))."\"";
}
function execute()
{
/* Create title */
function execute()
{
/* Create title */
- $name = "<img alt='' src='images/small_filter.png' class='center'>";
+ $name = "<img alt='' src='images/lists/action.png' class='center'>";
$name .= "<b>"._("Condition")."</b>";
if($this->TYPE == "if"){
$name .= " - "._("If");
$name .= "<b>"._("Condition")."</b>";
if($this->TYPE == "if"){
$name .= " - "._("If");
}
default :
{
}
default :
{
- trigger_error(_("Unhandled switch type"));
+ trigger_error(_("Unknown switch type"));
}
}
}
}
}
}
$Match_type = $node['text'];
/* Get value operator */
$Match_type = $node['text'];
/* Get value operator */
- if(in_array($Match_type,array(":value",":count"))){
+ if(in_array_strict($Match_type,array(":value",":count"))){
$i ++;
$node = $data[$i];
$i ++;
$node = $data[$i];
/* Skip first values, [if,not,exists] */
$node = $data[$id];
/* Skip first values, [if,not,exists] */
$node = $data[$id];
- while(in_array($node['text'],array("if","not","exists"))){
+ while(in_array_strict($node['text'],array("if","not","exists"))){
$id ++;
$node = $data[$id];
}
$id ++;
$node = $data[$id];
}
$next = NULL;
$num = 0;
for($i = $id ; $i < count($data) ; $i++ ){
$next = NULL;
$num = 0;
for($i = $id ; $i < count($data) ; $i++ ){
- if(in_array($data[$i]['class'],array("left-parant","left-bracket"))){
+ if(in_array_strict($data[$i]['class'],array("left-parant","left-bracket"))){
$open_brakets ++;
}
if($data[$i]['class'] == "comma" && $open_brakets == 1){
$num ++;
}
$open_brakets ++;
}
if($data[$i]['class'] == "comma" && $open_brakets == 1){
$num ++;
}
- if(!in_array($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
+ if(!in_array_strict($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
$par[$num][] = $data[$i];
}
$par[$num][] = $data[$i];
}
- if(in_array($data[$i]['class'],array("right-parant","right-bracket"))){
+ if(in_array_strict($data[$i]['class'],array("right-parant","right-bracket"))){
$open_brakets --;
}
}
$open_brakets --;
}
}