r54747 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54746‎ | r54747 | r54748 >
Date:21:15, 10 August 2009
Author:ialex
Status:ok
Tags:
Comment:
the result of this function is directly passed to foreach and thus avoid some errors such "Invalid arguments supplied for foreach"
Modified paths:
  • /trunk/phase3/maintenance/importImages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/importImages.inc
@@ -18,6 +18,7 @@
1919 function findFiles( $dir, $exts ) {
2020 if( is_dir( $dir ) ) {
2121 if( $dhl = opendir( $dir ) ) {
 22+ $files = array();
2223 while( ( $file = readdir( $dhl ) ) !== false ) {
2324 if( is_file( $dir . '/' . $file ) ) {
2425 list( /* $name */, $ext ) = splitFilename( $dir . '/' . $file );
@@ -27,10 +28,10 @@
2829 }
2930 return $files;
3031 } else {
31 - return false;
 32+ return array();
3233 }
3334 } else {
34 - return false;
 35+ return array();
3536 }
3637 }
3738

Status & tagging log