Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -622,8 +622,11 @@ |
623 | 623 | continue; |
624 | 624 | } |
625 | 625 | $dir = opendir( $path ); |
626 | | - while ( false !== ( $name = readdir( $dir ) ) ) { |
627 | | - call_user_func( $callback, $path . '/' . $name ); |
| 626 | + if ($dir) { |
| 627 | + while ( false !== ( $name = readdir( $dir ) ) ) { |
| 628 | + call_user_func( $callback, $path . '/' . $name ); |
| 629 | + } |
| 630 | + closedir( $dir ); |
628 | 631 | } |
629 | 632 | } |
630 | 633 | } |