summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9453f95)
raw | patch | inline | side by side (parent: 9453f95)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 22 Jul 2009 10:58:13 +0000 (10:58 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 22 Jul 2009 10:58:13 +0000 (10:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13942 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc b/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc
index b151dc579a12f4026619f99f064e3b0c39dfe2f7..76012c045dff2083437bbc1f49c3548534ead563 100644 (file)
$option= "";
$properties= array();
- $fh= gzopen ($ppdFile, 'r');
+ // Check for empty files
+ if(!filesize($ppdFile)) {
+ trigger_error(_('Parsing PPD file failed - file is empty!'));
+ return;
+ }
+
+ $fh= gzopen ($ppdFile, 'r');
while (!gzeof($fh) && $fh){
/* Read line */
- $line= gzgets($fh, 256);
+ $line= gzgets($fh, 256);
if (strlen($line) >= 256){
- trigger_error(_('Parsing PPD file %s failed - line too long. Trailing characters have been ignored'), E_USER_WARNING);
+ trigger_error(_('Parsing PPD file %s failed - line too long. Trailing characters have been ignored!'), E_USER_WARNING);
}
/* Trigger for option groups */
/* Possible value? */
if (preg_match("@^\*$eoption\s+@", $line)){
-#*PageSize Letter/US Letter: "<>setpagedevice"
+ #*PageSize Letter/US Letter: "<>setpagedevice"
$c= preg_replace("@^\*$eoption\s+([^/]+).*$@", "$1", $line);
$d= preg_replace("@^\*$eoption\s+[^/]+/([^:]+).*$@", "$1", $line);
if(empty($group)){
function loadDescription($ppdFile)
{
-
- $ppdDesc = array();
+ // Check for empty files
+ if(!filesize($ppdFile)) {
+ trigger_error(_('Parsing PPD file failed - file is empty!'));
+ return;
+ }
+
+ $ppdDesc = array();
/* Only parse complete PPD file again, if it was changed */
$modified = filemtime($ppdFile);