getshells() now returns an empty array if $_SESSION['lampath'] is not set

This commit is contained in:
Roland Gruber 2004-10-16 13:58:08 +00:00
parent 153da7bf86
commit 4ec2a4ef4f
1 changed files with 15 additions and 12 deletions

View File

@ -36,8 +36,9 @@ $Id$
*/
function getshells() {
// Load shells from file
$shells = file($_SESSION['lampath'].'config/shells');
$i=0;
if (file_exists($_SESSION['lampath'] . 'config/shells')) {
$shells = file($_SESSION['lampath'] . 'config/shells');
$i = 0;
while (count($shells) > $i) {
// remove whitespaces
trim($shells[$i]);
@ -50,6 +51,8 @@ function getshells() {
// $shells is array with all valid shells
return $shells;
}
else return array();
}
/* This function will replace umlates with ascci-chars