From: Alexandre Emsenhuber Date: Mon, 10 Aug 2009 21:15:46 +0000 (+0000) Subject: the result of this function is directly passed to foreach and thus avoid some errors... X-Git-Tag: 1.31.0-rc.0~40374 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=8a0c421e40d37ffee6ec0c32d4838fd229b16b4b;p=lhc%2Fweb%2Fwiklou.git the result of this function is directly passed to foreach and thus avoid some errors such "Invalid arguments supplied for foreach" --- diff --git a/maintenance/importImages.inc b/maintenance/importImages.inc index 290f3c0794..1f693fa108 100644 --- a/maintenance/importImages.inc +++ b/maintenance/importImages.inc @@ -18,6 +18,7 @@ function findFiles( $dir, $exts ) { if( is_dir( $dir ) ) { if( $dhl = opendir( $dir ) ) { + $files = array(); while( ( $file = readdir( $dhl ) ) !== false ) { if( is_file( $dir . '/' . $file ) ) { list( /* $name */, $ext ) = splitFilename( $dir . '/' . $file ); @@ -27,10 +28,10 @@ function findFiles( $dir, $exts ) { } return $files; } else { - return false; + return array(); } } else { - return false; + return array(); } }