Code

Updated FAIscript and encoding handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Jul 2010 13:33:54 +0000 (13:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Jul 2010 13:33:54 +0000 (13:33 +0000)
-Respect encoding modification for uploaded scripts too.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18967 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc

index edafad3cf699257c2a9f54fb1b69c056c91ac8ec..9f42d330203e168db9b3520ae6990348b4f1f3a7 100644 (file)
@@ -76,6 +76,14 @@ class faiScriptEntry extends plugin
                 }else{
                     $str = file_get_contents($_FILES['ImportFile']['tmp_name']);
                     $this->FAIscript = $str;
+
+                    // Check encoding again 
+                    if($this->mb_extension){
+                        $this->enc_before_edit = mb_detect_encoding($this->FAIscript);
+                        if($this->enc_before_edit != "ASCII"){
+                            $this->write_protect = TRUE;
+                        }
+                    }
                 }
         }