X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_debconfTemplate.inc;h=d781321ec8daba9f701e18fa561ff5738a966e41;hb=895712accc11cf9defc13cdbc64a6b3c7e7e548a;hp=4d94d0e9407f10777580dc05e738c1a325b620ba;hpb=9ddb202ea02bc482600c1dc5d1edf2c509e4d44b;p=gosa.git diff --git a/include/class_debconfTemplate.inc b/include/class_debconfTemplate.inc index 4d94d0e94..d781321ec 100644 --- a/include/class_debconfTemplate.inc +++ b/include/class_debconfTemplate.inc @@ -53,9 +53,19 @@ class debconf $in_description = FALSE; $got_local_description = FALSE; + /* get filename */ + $filename= preg_replace("/\/+/", "/", $this->template_directory."/".$this->package.".templates"); + + /* Check if file is readable */ + if (!is_file($filename) || !is_readable($filename)){ + return(FALSE); + } + + /* Open file and read content line by line */ $fh= fopen($filename, 'r'); - while (!feof($fh)){ + /* While the file handle is valid && there is still data to read -> parse configuration file */ + while ($fh && !feof($fh)){ $line= fgets($fh, 1024); /* Reset description flag */