Code

If we use stripslashes to display, we should use addslahes at construction.
[gosa.git] / plugins / admin / fai / class_faiVariableEntry.inc
index 745baeeadb255ebcc5a114a411977cad0f46276d..fa4bd2e5b7783c27ca78fcff5f9c84428fb96de3 100644 (file)
@@ -27,7 +27,7 @@ class faiVariableEntry extends plugin
       $this->dn=$object['dn'];
       foreach($object as $name=>$value){
         $oname = "Object_".$name;
-        $this->$oname=$value;
+        $this->$oname=addslashes($value);
       }
     }else{
       $this->Object_status = "new";
@@ -46,9 +46,9 @@ class faiVariableEntry extends plugin
      */
     foreach($this->attributes as $attrs){
       if(get_magic_quotes_gpc()){
-        $smarty->assign($attrs,stripslashes($this->$attrs));
+        $smarty->assign($attrs,htmlentities (stripslashes($this->$attrs)));
       }else{
-        $smarty->assign($attrs,($this->$attrs));
+        $smarty->assign($attrs,htmlentities (($this->$attrs)));
       }
     }
 
@@ -83,7 +83,7 @@ class faiVariableEntry extends plugin
       $message[] = _("Please enter a name.");
     }
 
-    if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
+    if(preg_match("/[^0-9a-z_]/i",$this->Object_cn)){
       $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
     }
  
@@ -95,7 +95,7 @@ class faiVariableEntry extends plugin
     $tmp=array();
     foreach($this->attributes as $attrs){ 
       $attr = preg_replace("/^Object_/","",$attrs);
-      $tmp[$attr] = $this->$attrs;
+      $tmp[$attr] = stripslashes( $this->$attrs);
     }
 
     if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){