diff --git a/include/sieve/class_sieveElement_Vacation.inc b/include/sieve/class_sieveElement_Vacation.inc
index edb0efd763cc700a53855dbb5e28413bee85ffd6..477a7fe0ce2520c89d323f33c13e99101e80abae 100644 (file)
var $from = "";
var $mime = "";
var $handle = "";
- var $reason = "";
+ var $reason = "\"I am not available, currently.\"";
var $addresses= array();
var $object_id= -1;
var $Expert = FALSE;
foreach($strs as $str){
$data .= $str;
}
- $this->reason = $data;//preg_replace("/\"/","",$data);
+ $this->reason = $data;
}
}
}
if($this->mime){
$str.= ":mime ".sieve_create_strings($this->mime);
}
- $str .= "\n ".sieve_create_strings($this->reason);
+
+ /* Append reason and ensure that this will be
+ * handled as multiline text element
+ * by adding a "\n" new line
+ */
+ $str .= "\n ".sieve_create_strings($this->reason."\n");
return($str." ; \n");
}
foreach($tmp2 as $val){
$ad = trim(preg_replace("/\"/","",$val));
if(!empty($ad)){
- $tmp[] = "\"".$ad."\"";
+ $tmp[] = $ad;
}
}
$this->addresses = $tmp;
/* Get reason */
if(isset($_POST['vacation_reason_'.$this->object_id])){
$vr = stripslashes ($_POST['vacation_reason_'.$this->object_id]);
- $this->reason = "\"".trim(preg_replace("/\"/","",$vr))."\"";
+ $this->reason = trim($vr);
}
}
$msgs = array();
$err = FALSE;
foreach($this->addresses as $addr){
- if(!is_email(preg_replace("/\"/","",$addr))){
+ if(!is_email($addr)){
$err = true;
}
}
$object_container = $smarty->fetch(get_template_path("templates/object_container.tpl",TRUE,dirname(__FILE__)));
$object= $smarty->fetch(get_template_path("templates/element_vacation.tpl",TRUE,dirname(__FILE__)));
- $str = preg_replace("/%%OBJECT_CONTENT%%/",$object,$object_container);
+ $str = preg_replace("/%%OBJECT_CONTENT%%/",addcslashes($object,"\\"),$object_container);
return($str);
}
}