From a87094fb16001188e8b7ba856e51185534e64ce1 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sun, 8 Apr 2012 21:27:53 +1200 Subject: [PATCH] BUGFIX: check for valid directory before opening --- code/DocumentationService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/DocumentationService.php b/code/DocumentationService.php index f9a7b24..be119d1 100755 --- a/code/DocumentationService.php +++ b/code/DocumentationService.php @@ -330,7 +330,7 @@ class DocumentationService { * @return string */ 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))); if(!$name || $name == '/') $name = 'index'; @@ -377,10 +377,10 @@ class DocumentationService { } } } + + closedir($handle); } - closedir($handle); - return false; }