r110114 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110113‎ | r110114 | r110115 >
Date:11:54, 27 January 2012
Author:cneubauer
Status:ok
Tags:
Comment:
Fix from Dzrraf2 to avoid issues if directory does not open.
Modified paths:
  • /trunk/extensions/UploadLocal/UploadLocalDirectory.php (modified) (history)

Diff [purge]

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

Status & tagging log