Code

Removed carriage return from uploaded FAI files.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Dec 2010 10:23:34 +0000 (10:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Dec 2010 10:23:34 +0000 (10:23 +0000)
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
gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc

index 09b5d8dbfb4cb528ea11ee4d4f0882e639643de8..fc909132eb3d763eb4b8715978ea89ba03f69ae8 100644 (file)
@@ -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);
       }
     }
index db8366b1b2fee0d83bdad0e9cf782df4db72d3b0..0cb845c902ccb2effd350188ef31fb8e00727d27 100644 (file)
@@ -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;
       }
     }
index 2902562ee9d7d4ebf4bb35ba39d0c5c1b0657efe..d95c1b7f4e9214063ed19680e118f6f85453bfc2 100644 (file)
@@ -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. */