check for extension dir before reading contents

This commit is contained in:
Uwe Steinmann 2015-05-04 07:14:24 +02:00
parent a5c27190c1
commit 9b643fa700

View File

@ -76,16 +76,18 @@ class SeedDMS_Extension_Mgr {
function getExtensions() { /* {{{ */
$extensions = array();
$handle = opendir($this->extdir);
while ($entry = readdir($handle) ) {
if ($entry == ".." || $entry == ".")
continue;
else if (is_dir($this->extdir ."/". $entry))
array_push($extensions, $entry);
}
closedir($handle);
if(file_exists($this->extdir)) {
$handle = opendir($this->extdir);
while ($entry = readdir($handle) ) {
if ($entry == ".." || $entry == ".")
continue;
else if (is_dir($this->extdir ."/". $entry))
array_push($extensions, $entry);
}
closedir($handle);
asort($extensions);
asort($extensions);
}
return $extensions;
} /* }}} */
}