MFT r114675; infinite loop fix
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 9 Apr 2012 23:02:21 +0000 (16:02 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 9 Apr 2012 23:02:21 +0000 (16:02 -0700)
Change-Id: Ic688143bb6f414aabf19481cffceaf5bbc2d70df

FancyCaptcha.class.php

index 3ce5670e4ecba395b4a0dfaf47820ebe447dcdfd..6da3207d5a954f9923f6ccaf0ebc625dfc5149aa 100644 (file)
@@ -97,6 +97,9 @@ class FancyCaptcha extends SimpleCaptcha {
 
                        // Check which subdirs are actually present...
                        $dir = opendir( $directory );
+                       if ( !$dir ) {
+                               return false;
+                       }
                        while ( false !== ( $entry = readdir( $dir ) ) ) {
                                if ( ctype_xdigit( $entry ) && strlen( $entry ) == 1 ) {
                                        $dirs[] = $entry;