From b8ca8c7827e8b7ae3803e3babc7e37516ed0ac70 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 20 May 2011 22:08:04 +0000 Subject: [PATCH] Cleanup to extension directory checks. Saves a check for something silly like /extensions/README/README.php --- includes/installer/Installer.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index bb87390543..3cfdfc36ed 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1198,11 +1198,14 @@ abstract class Installer { } $exts = array(); - $dir = $this->getVar( 'IP' ) . '/extensions'; - $dh = opendir( $dir ); + $extDir = $this->getVar( 'IP' ) . '/extensions'; + $dh = opendir( $extDir ); while ( ( $file = readdir( $dh ) ) !== false ) { - if( file_exists( "$dir/$file/$file.php" ) ) { + if( !is_dir( "$extDir/$file" ) ) { + continue; + } + if( file_exists( "$extDir/$file/$file.php" ) ) { $exts[] = $file; } } -- 2.20.1