Code

Fixed DOS newline handling
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Feb 2006 08:57:26 +0000 (08:57 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 9 Feb 2006 08:57:26 +0000 (08:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2648 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHookEntry.inc
plugins/admin/fai/class_faiScriptEntry.inc

index a9b67e450c97a5e5a3e9be3c75275da8e03363da..8232a156005a1d189d7503ca4f881d74216a9984 100644 (file)
@@ -106,7 +106,6 @@ class faiHookEntry extends plugin
           $this->$attrs = "";
         }
       }
-      $this->FAIscript= recode("DOS..LATIN1", $this->FAIscript);
     }
   }
 
@@ -132,6 +131,9 @@ class faiHookEntry extends plugin
       $tmp[$attrs] = $this->$attrs;
     }
 
+    /* Strip out dos newlines */
+    $tmp['FAIscript']= strtr($this->FAIscript, array("\x0D" => ""));
+
     if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){
       $tmp['remove']['from']  = $this->orig_cn;
       $tmp['remove']['to']    = $tmp['cn'];
index fa9da837a6336e758bc07ec2eadc2009d0ac8584..28d8fb07c8e48d7f213aa8baf5791d5dc4cb9fed 100644 (file)
@@ -96,7 +96,6 @@ class faiScriptEntry extends plugin
           $this->$attrs = "";
         }
       }
-      $this->FAIscript= recode("DOS..LATIN1", $this->FAIscript);
     }
   }
 
@@ -123,6 +122,9 @@ class faiScriptEntry extends plugin
       $tmp[$attrs] = $this->$attrs;
     }
 
+    /* Strip out dos newlines */
+    $tmp['FAIscript']= strtr($this->FAIscript, array("\x0D" => ""));
+
     if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){
       $tmp['remove']['from']  = $this->orig_cn;
       $tmp['remove']['to']    = $tmp['cn'];