diff --git a/include/sieve/class_sieveElement_Require.inc b/include/sieve/class_sieveElement_Require.inc
index 3b91b8205f8d0b065fb55953dd3be32e1f4c85af..c7138deb569e76f8eb22d79fecf2cda365c61d67 100644 (file)
}
}
+ /* 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);
+ }
+ if(!in_array($str,$current)){
+ $this->data[] = $str;
+ }
+ $this->data = array_unique($this->data);;
+ }
+
function save_object()
{
/* Get the values should check for, they are seperated by , */
if(empty($val)) continue;
- $tmp[] = "\"".$val."\"";
+ $tmp[] = $val;
}
$this->data = $tmp;
}
{
$Require = "";
foreach($this->data as $key){
- $Require .= $key.", ";
+ $Require .= "\"".$key."\"".", ";
}
$Require = preg_replace("/,$/","",trim($Require));