From 8d9d90a8672734a18b2dc5619ce2c06c109c75e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 29 Mar 2007 08:10:27 +0000 Subject: [PATCH] Updated some sieve classes, to handle quotes correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5918 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_sieveElement_Fileinto.inc | 5 ++--- include/sieve/class_sieveElement_Redirect.inc | 19 ++++++++++++------- include/sieve/templates/element_fileinto.tpl | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/include/sieve/class_sieveElement_Fileinto.inc b/include/sieve/class_sieveElement_Fileinto.inc index 80b4c3aac..de30a9a1f 100644 --- a/include/sieve/class_sieveElement_Fileinto.inc +++ b/include/sieve/class_sieveElement_Fileinto.inc @@ -13,8 +13,7 @@ class sieve_fileinto $mbs = $this->get_mail_boxes(); if(isset($_POST['fileinto_'.$this->object_id])){ - $mb = $_POST['fileinto_'.$this->object_id]; - + $mb = stripslashes($_POST['fileinto_'.$this->object_id]); /* Depending on the user mode we only accept * existing mailboxes @@ -74,7 +73,7 @@ class sieve_fileinto function execute() { $smarty = get_smarty(); - $smarty->assign("Selected",$this->data); + $smarty->assign("Selected",htmlentities($this->data)); $smarty->assign("Boxes", $this->get_mail_boxes()); $smarty->assign("User_Mode", $this->user_mode); $smarty->assign("ID", $this->object_id); diff --git a/include/sieve/class_sieveElement_Redirect.inc b/include/sieve/class_sieveElement_Redirect.inc index 67bc934a1..4f19c67e8 100644 --- a/include/sieve/class_sieveElement_Redirect.inc +++ b/include/sieve/class_sieveElement_Redirect.inc @@ -1,7 +1,7 @@ object_id])){ $rt = stripslashes($_POST['redirect_to_'.$this->object_id]); - $rt = "\"".trim(preg_replace("/\"/","",$rt))."\""; + $rt = trim($rt); $this->data = $rt; } } @@ -20,7 +20,7 @@ class sieve_redirect { $msgs = array(); - if(!is_email(preg_replace("/\"/","",$this->data))){ + if(!is_email($this->data)){ $msgs[] =_("Please specify a valid email address."); } @@ -35,9 +35,15 @@ class sieve_redirect $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => _("Put a mail address here")))); } - foreach($data['ELEMENTS'] as $node ){ + foreach($data['ELEMENTS'] as $key => $node ){ if(in_array($node['class'],array("quoted-string","text"))){ - $this->data = $node['text']; + $tmp = sieve_get_strings($data['ELEMENTS'],$key); + if(count($tmp['STRINGS'])){ + + foreach($tmp['STRINGS'] as $str){ + $this->data.= $str; + } + } } } } @@ -51,8 +57,7 @@ class sieve_redirect function execute() { - $values = $this->data; - + $values = htmlentities($this->data); $smarty = get_smarty(); $smarty->assign("ID", $this->object_id); $smarty->assign("Destinations" , $values); diff --git a/include/sieve/templates/element_fileinto.tpl b/include/sieve/templates/element_fileinto.tpl index 65db0481f..c6ae998e0 100644 --- a/include/sieve/templates/element_fileinto.tpl +++ b/include/sieve/templates/element_fileinto.tpl @@ -17,7 +17,7 @@ {t}Folder{/t} {if $User_Mode} - + {else}