From 2b764e27bb7af589bfd1898dd897033c4c37eb34 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 13 Dec 2010 10:23:34 +0000 Subject: [PATCH] Removed carriage return from uploaded FAI files. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20550 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_faiHookEntry.inc | 1 + gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc | 1 + gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc | 1 + 3 files changed, 3 insertions(+) diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc index 09b5d8dbf..fc909132e 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc @@ -65,6 +65,7 @@ class faiHookEntry extends plugin msg_dialog::display(_("Error"), msgPool::incorrectUpload(_("file is empty")), ERROR_DIALOG); }else{ $str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name'])); + $str = preg_replace("/[\r]/","",$str); $this->FAIscript = addslashes ($str); } } diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index db8366b1b..0cb845c90 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -62,6 +62,7 @@ class faiScriptEntry extends plugin msg_dialog::display(_("Error"), msgPool::incorrectUpload(_("file is empty")), ERROR_DIALOG); }else{ $str = utf8_encode(addslashes(file_get_contents($_FILES['ImportFile']['tmp_name']))); + $str = preg_replace("/[\r]/","",$str); $this->FAIscript = $str; } } diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc index 2902562ee..d95c1b7f4 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc @@ -69,6 +69,7 @@ class faiTemplateEntry extends plugin if(isset($_POST['TmpFileUpload']) && $this->acl_is_writeable("FAItemplateFile")){ if($str=file_get_contents($_FILES['FAItemplateFile']['tmp_name'])){ + $str = preg_replace("/[\r]/","",$str); $this->FAItemplateFile = $str; /* If we don't have a filename set it from upload filename. */ -- 2.30.2