summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5b7736)
raw | patch | inline | side by side (parent: b5b7736)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 Mar 2007 12:38:27 +0000 (12:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 Mar 2007 12:38:27 +0000 (12:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5789 594d385d-05f5-0310-b6e9-bd551577e9d8
include/sieve/class_My_Tree.inc | patch | blob | history | |
include/sieve/class_sieveElement_Vacation.inc | patch | blob | history |
index 0ac92a0c12b079763af3c95746afa4914b1a53f0..901018c655d8ac8bd26d2818e47500f4ec4eaec5 100644 (file)
/* Create valid sieve string/string-list
* out of a given array
*/
-function sieve_create_strings($data)
+function sieve_create_strings($data,$force_string = FALSE)
{
$ret = "";
if(is_array($data)){
$Multiline = preg_match("/\n/",$data);
$data = preg_replace("/\r/","",$data);;
- if($Multiline){
+ if($Multiline && !$force_string){
$ret = "text: \r\n".$data."\r\n.\r\n";
}else{
$ret = "\"".$data."\"";
$ret[] = $data[$id]['text'];
}elseif($data[$id]['class'] == "number"){
$ret[] = $data[$id]['text'];
+ }elseif($data[$id]['class'] == "multi-line"){
+ $str = trim(preg_replace("/^text:/","",$data[$id]['text']));
+ $str = trim(preg_replace("/\.$/","",$str));
+ $ret[] = $str;
}
+
return(array("OFFSET" => $id, "STRINGS" => $ret));
}
diff --git a/include/sieve/class_sieveElement_Vacation.inc b/include/sieve/class_sieveElement_Vacation.inc
index f2a562fcaaf518ccc820a70de711c825c734d129..1809cad8b321b5db8f6c7b95c2f2e68b1355c266 100644 (file)
$known_attrs = array(":days",":subject",":from",":mime",":handle");
/* skip if empty */
- if($data == NULL) return;
+ if(($data == NULL) || !is_array($data)) return;
/* Walk through elements */
for($i = 0 ; $i < count($data['ELEMENTS']) ; $i ++){
}
/* Add the vacation message */
- if($node['class'] == "quoted-string"){
- $this->reason = $node['text'];
+ if(in_array($node['class'],array("quoted-string","multi-line"))){
+
+ $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+ $strs= $tmp['STRINGS'];
+
+ $data = "";
+ foreach($strs as $str){
+ $data .= $str;
+ }
+ $this->reason = $data;//preg_replace("/\"/","",$data);
}
}
}