From: Nick Jenkins Date: Mon, 29 Jan 2007 07:52:45 +0000 (+0000) Subject: Prevent under E_STRICT - Strict Standards: opendir(/var/www/hosts/mediawiki/wiki... X-Git-Tag: 1.31.0-rc.0~54170 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=adbbd43292587ded7c637b3f6232f4eee966c364;p=lhc%2Fweb%2Fwiklou.git Prevent under E_STRICT - Strict Standards: opendir(/var/www/hosts/mediawiki/wiki/images/thumb/9/9e/file.jpg) [function.opendir]: failed to open dir: No such file or directory in /var/www/hosts/mediawiki/wiki/includes/Image.php on line 1321. --- diff --git a/includes/Image.php b/includes/Image.php index 27745084d8..4c6beaf2c6 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1317,16 +1317,17 @@ class Image $files = array(); $dir = wfImageThumbDir( $this->name, $shared ); - // This generates an error on failure, hence the @ - $handle = @opendir( $dir ); - - if ( $handle ) { - while ( false !== ( $file = readdir($handle) ) ) { - if ( $file{0} != '.' ) { - $files[] = $file; + if ( is_dir( $dir ) ) { + $handle = opendir( $dir ); + + if ( $handle ) { + while ( false !== ( $file = readdir($handle) ) ) { + if ( $file{0} != '.' ) { + $files[] = $file; + } } + closedir( $handle ); } - closedir( $handle ); } } else { $files = array();