r88496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88495‎ | r88496 | r88497 >
Date:22:08, 20 May 2011
Author:demon
Status:ok
Tags:
Comment:
Cleanup to extension directory checks. Saves a check for something silly like /extensions/README/README.php
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -1198,11 +1198,14 @@
11991199 }
12001200
12011201 $exts = array();
1202 - $dir = $this->getVar( 'IP' ) . '/extensions';
1203 - $dh = opendir( $dir );
 1202+ $extDir = $this->getVar( 'IP' ) . '/extensions';
 1203+ $dh = opendir( $extDir );
12041204
12051205 while ( ( $file = readdir( $dh ) ) !== false ) {
1206 - if( file_exists( "$dir/$file/$file.php" ) ) {
 1206+ if( !is_dir( "$extDir/$file" ) ) {
 1207+ continue;
 1208+ }
 1209+ if( file_exists( "$extDir/$file/$file.php" ) ) {
12071210 $exts[] = $file;
12081211 }
12091212 }

Status & tagging log