Code

Print a error message if files are 0-byte long,
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jul 2009 12:51:04 +0000 (12:51 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jul 2009 12:51:04 +0000 (12:51 +0000)
instead of trying to parse that empty file.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13902 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc

index db3e50c60c90f55c7887a7cc7c35fae716af36ae..db881d2260709c5b29f8e6f1706c55ea151bb830 100644 (file)
@@ -162,7 +162,11 @@ class ppdManager
        }
 
        function loadProperties($ppdFile)
-       {
+  {
+    if(!(filesize($ppdFile))) {
+      trigger_error(_('Parsing PPD file failed - File has 0 bytes'));
+    }
+
                $group= "";
                $option= "";
                $properties= array();
@@ -290,7 +294,11 @@ class ppdManager
        }
 
        function loadDescription($ppdFile)
-       {
+  {
+    if(!(filesize($ppdFile))) {
+      trigger_error(_('Parsing PPD file failed - File has 0 bytes'));
+    }
+
                $ppdDesc = array();
                                
                /* Only parse complete PPD file again, if it was changed */