summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b8f388)
raw | patch | inline | side by side (parent: 2b8f388)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 Mar 2007 09:04:47 +0000 (09:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 Mar 2007 09:04:47 +0000 (09:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5922 594d385d-05f5-0310-b6e9-bd551577e9d8
index cc9600b6b4ecc9b247fa381aeb5ed888c8bc3d53..32bf58a038a7057fc63566053ea443dbea0f1337 100644 (file)
$ret = preg_replace("/,$/","",trim($ret));
$ret = "[".$ret."]";
}
+ $ret = preg_replace("/\"\"/","\"",$ret);
}else{
$Multiline = preg_match("/\n/",$data);
while(isset($data[$id]) && $data[$id]['class'] != "right-bracket" && $id < count($data)){
if($data[$id]['class'] == "quoted-string"){
- $ret[] = $data[$id]['text'];
+ $text = $data[$id]['text'];
+ $text= preg_replace("/^\"/","",$text);
+ $text= preg_replace("/\"$/","",$text);
+ $ret[] = $text;
}
$id ++;
diff --git a/include/sieve/class_sieveElement_Fileinto.inc b/include/sieve/class_sieveElement_Fileinto.inc
index 6ac66371ca6fca283c5b7971a0a38611744dcbb1..f357d37d96d961bd4e1ea2065d8468deb9f985b8 100644 (file)
/* Load element contents, should normaly be only one string
* but if we found more than one, just append the following strings.
*/
- foreach($data['ELEMENTS'] as $key => $node ){
- if(in_array($node['class'],array("quoted-string","text"))){
- $tmp = sieve_get_strings($data['ELEMENTS'],$key);
- if(count($tmp['STRINGS'])){
- foreach($tmp['STRINGS'] as $str){
- $this->data.= $str;
- }
- }
+ for($i = 0 ; $i < count($data['ELEMENTS']) ; $i++){
+ $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+ $i = $i + $tmp['OFFSET'];
+ foreach($tmp['STRINGS'] as $str){
+ $this->data .= $str;
}
}
diff --git a/include/sieve/class_sieveElement_Redirect.inc b/include/sieve/class_sieveElement_Redirect.inc
index 4f19c67e87c7dbd1473a177e5ed6fe16e704a5df..56f55cf77bc5dad7be80b318927b6ea02955ef1d 100644 (file)
$data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => _("Put a mail address here"))));
}
- foreach($data['ELEMENTS'] as $key => $node ){
- if(in_array($node['class'],array("quoted-string","text"))){
- $tmp = sieve_get_strings($data['ELEMENTS'],$key);
- if(count($tmp['STRINGS'])){
-
- foreach($tmp['STRINGS'] as $str){
- $this->data.= $str;
- }
- }
+ for($i = 0 ; $i < count($data['ELEMENTS']) ; $i++){
+ $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+ $i = $i + $tmp['OFFSET'];
+ foreach($tmp['STRINGS'] as $str){
+ $this->data .= $str;
}
}
}
diff --git a/include/sieve/class_sieveElement_Reject.inc b/include/sieve/class_sieveElement_Reject.inc
index 0447c254a40d9d039a9b0b6c2bdfef320ae41604..398f6ed3644c511f295ca5096c8e4f42e6853ece 100644 (file)
{
if(isset($_POST['reject_message_'.$this->object_id])){
$msg = stripslashes($_POST['reject_message_'.$this->object_id]);
-
$this->data = $msg;
}
}
$this->data = _("Your reject text here");
}else{
- /* Get reject text */
- $str = "";
- foreach($data['ELEMENTS'] as $node ){
- if(in_array($node['class'],array("quoted-string","text","multi-line"))){
-
- if($node['class'] == "multi-line"){
- $str .= preg_replace("/^text:[ \n\r]*/","",$node['text']);
- $str = preg_replace("/[ \n\r]*\.[ \n\r]*$/","",$str);
- }else{
- $str .= $node['text'];
- }
+ for($i = 0 ; $i < count($data['ELEMENTS']) ; $i++){
+ $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+ $i = $i + $tmp['OFFSET'];
+ foreach($tmp['STRINGS'] as $str){
+ $this->data .= $str;
}
}
- $this->data = preg_replace("/\"/","",$str);
}
}
diff --git a/include/sieve/class_sieveElement_Require.inc b/include/sieve/class_sieveElement_Require.inc
index 535c591e86a73da987331e3766b6d2d89719b371..0a781daadee488c6571210dfbf1a534f512785e6 100644 (file)
$this->object_id = $object_id;
if($data != NULL){
- foreach($data['ELEMENTS'] as $node ){
- if(in_array($node['class'],array("quoted-string","text"))){
- $this->data[] = preg_replace("/\"/","",$node['text']);
+ for($i = 0 ; $i < count($data['ELEMENTS']) ; $i++){
+ $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+ $i = $i + $tmp['OFFSET'];
+ foreach($tmp['STRINGS'] as $str){
+ $this->data[]= $str;
}
}
}
}
+
/* Add a new require statement and ensure
* that it is not specified twice
*/
function Add_Require($str)
{
$current = array();
-
foreach($this->data as $dat){
- $current[] = preg_replace("/\"/","",$dat);
+ $current[] = $dat;
}
if(!in_array($str,$current)){
$this->data[] = $str;
$tmp2 = split(",",$vls);
foreach($tmp2 as $val){
- $val = trim(preg_replace("/\"/","",$val));
+ $val = trim($val);
if(empty($val)) continue;
{
$Require = "";
foreach($this->data as $key){
- $Require .= "\"".$key."\"".", ";
+ $Require .= $key.", ";
}
$Require = preg_replace("/,$/","",trim($Require));