fixed bug 3107124, config/shell parsing
This commit is contained in:
parent
106462ced7
commit
cac820c1ad
|
@ -1,6 +1,8 @@
|
||||||
December 2010 3.3.0
|
December 2010 3.3.0
|
||||||
- additional usability enhancements
|
- additional usability enhancements
|
||||||
- PDF export: higher resolution for logos
|
- PDF export: higher resolution for logos
|
||||||
|
- fixed bugs:
|
||||||
|
-> ignore comment lines in shells file (3107124)
|
||||||
|
|
||||||
|
|
||||||
28.10.2010 3.2.0
|
28.10.2010 3.2.0
|
||||||
|
|
|
@ -39,24 +39,23 @@ $Id$
|
||||||
* @return array list of shell names
|
* @return array list of shell names
|
||||||
*/
|
*/
|
||||||
function getshells() {
|
function getshells() {
|
||||||
|
$return = array();
|
||||||
$shellPath = dirname(__FILE__) . '/../config/shells';
|
$shellPath = dirname(__FILE__) . '/../config/shells';
|
||||||
// Load shells from file
|
// load shells from file
|
||||||
if (file_exists($shellPath)) {
|
if (file_exists($shellPath)) {
|
||||||
$shells = file($shellPath);
|
$shells = file($shellPath);
|
||||||
$i = 0;
|
for ($i = 0; $i < sizeof($shells); $i++) {
|
||||||
while (count($shells) > $i) {
|
// remove whitespaces and line end
|
||||||
// remove whitespaces
|
$shells[$i] = trim($shells[$i]);
|
||||||
trim($shells[$i]);
|
|
||||||
// remove lineend
|
|
||||||
$shells[$i] = substr($shells[$i], 0, strpos($shells[$i], "\n"));
|
|
||||||
// remove comments
|
// remove comments
|
||||||
if ($shells[$i]{0}=='#') unset ($shells[$i]);
|
if ((strlen($shells[$i]) == 0) || $shells[$i]{0}=='#') {
|
||||||
else $i++;
|
continue;
|
||||||
}
|
}
|
||||||
// $shells is array with all valid shells
|
$return[] = $shells[$i];
|
||||||
return $shells;
|
|
||||||
}
|
}
|
||||||
else return array();
|
return $return;
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue