BUGFIX: check for valid directory before opening

This commit is contained in:
Will Rossiter 2012-04-08 21:27:53 +12:00
parent 34d46b7a5b
commit a87094fb16

View File

@ -330,7 +330,7 @@ class DocumentationService {
* @return string * @return string
*/ */
private static function find_page_recursive($base, $goal) { private static function find_page_recursive($base, $goal) {
$handle = opendir($base); $handle = (is_dir($base)) ? opendir($base) : false;
$name = self::trim_extension_off(strtolower(array_shift($goal))); $name = self::trim_extension_off(strtolower(array_shift($goal)));
if(!$name || $name == '/') $name = 'index'; if(!$name || $name == '/') $name = 'index';
@ -377,9 +377,9 @@ class DocumentationService {
} }
} }
} }
}
closedir($handle); closedir($handle);
}
return false; return false;
} }