Index: trunk/extensions/UploadLocal/UploadLocalDirectory.php |
— | — | @@ -137,6 +137,10 @@ |
138 | 138 | if ($directory[strlen($directory)-1] !== '/') $directory .= '/'; |
139 | 139 | $dh = opendir($directory); |
140 | 140 | $filenames = array(); |
| 141 | + # Make sure the handle opens correctly |
| 142 | + if( !$dh ) { |
| 143 | + return $filenames; |
| 144 | + } |
141 | 145 | while (($file = readdir($dh)) !== false) { |
142 | 146 | if ($file == '.' || $file == '..') continue; |
143 | 147 | // check if it's a directory |