Thread:Extension talk:UploadLocal/patches

Where to post patches: email ? bugtracker ? other ? anyway:

= sorting files lexically = Index: UploadLocalDirectory.php

=
====================================================== --- UploadLocalDirectory.php	(révision 110402) +++ UploadLocalDirectory.php	(copie de travail) @@ -151,6 +151,7 @@ 			} 			$filenames[] = $file; } +		sort($filenames); closedir($dh); return $filenames; }

= small clean up = Index: UploadLocalDirectory.php

=
====================================================== --- UploadLocalDirectory.php	(révision 110402) +++ UploadLocalDirectory.php	(copie de travail) @@ -133,8 +133,7 @@ 	} 	function getFilenamesOfFilesInDirectory($directory) { -		if (!is_dir($directory)) return array; -		if ($directory[strlen($directory)-1] !== '/') $directory .= '/'; +	 if (! is_dir($directory) || ! is_readable($directory)) return array; $dh = opendir($directory); $filenames = array; # Make sure the handle opens correctly @@ -144,7 +143,7 @@ 		while (($file = readdir($dh)) !== false) { if ($file == '.' || $file == '..') continue; // check if it's a directory -			if (is_dir($directory. $file)) continue; +			if (is_dir($directory. '/' . $file)) continue; // check if it's a hidden file - regexp: /\.[^.]+/ if ($file[0] == '.' && strpos($file,'.',1) === false) { continue;