From 794497334b93283af6766331a4fefe18a722b298 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 9 Feb 2006 08:57:26 +0000 Subject: [PATCH] Fixed DOS newline handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2648 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHookEntry.inc | 4 +++- plugins/admin/fai/class_faiScriptEntry.inc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/admin/fai/class_faiHookEntry.inc b/plugins/admin/fai/class_faiHookEntry.inc index a9b67e450..8232a1560 100644 --- a/plugins/admin/fai/class_faiHookEntry.inc +++ b/plugins/admin/fai/class_faiHookEntry.inc @@ -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']; diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc index fa9da837a..28d8fb07c 100644 --- a/plugins/admin/fai/class_faiScriptEntry.inc +++ b/plugins/admin/fai/class_faiScriptEntry.inc @@ -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']; -- 2.30.2