From 9734b9be8584357bf77845b8dfaa398ae9d39131 Mon Sep 17 00:00:00 2001 From: Russ Nelson Date: Wed, 30 Mar 2011 01:49:38 +0000 Subject: [PATCH] missing closedir() and ... protected the readdir against opendir() failing --- includes/filerepo/FSRepo.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index b7b066e267..d3741171b1 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -622,8 +622,11 @@ class FSRepo extends FileRepo { continue; } $dir = opendir( $path ); - while ( false !== ( $name = readdir( $dir ) ) ) { - call_user_func( $callback, $path . '/' . $name ); + if ($dir) { + while ( false !== ( $name = readdir( $dir ) ) ) { + call_user_func( $callback, $path . '/' . $name ); + } + closedir( $dir ); } } } -- 2.20.1