From: <de...@de...> - 2013-01-29 05:05:27
|
Author: PeterThoeny Date: 2013-01-28 23:05:21 -0600 (Mon, 28 Jan 2013) New Revision: 24831 Trac url: http://develop.twiki.org/trac/changeset/24831 Modified: twiki/trunk/TagMePlugin/lib/TWiki/Plugins/TagMePlugin.pm Log: Item7091: Never assume that the first two directory entries are . and .., on Windows arbitrary files would be eliminated Modified: twiki/trunk/TagMePlugin/lib/TWiki/Plugins/TagMePlugin.pm =================================================================== --- twiki/trunk/TagMePlugin/lib/TWiki/Plugins/TagMePlugin.pm 2013-01-29 04:55:45 UTC (rev 24830) +++ twiki/trunk/TagMePlugin/lib/TWiki/Plugins/TagMePlugin.pm 2013-01-29 05:05:21 UTC (rev 24831) @@ -1488,9 +1488,10 @@ my @list; my $workDir = _workAreaDir($web); if ( opendir( DIR, $workDir ) ) { - my @files = readdir(DIR); + my @files = sort + grep { !/^\./ } # eliminate . and .. + readdir(DIR); closedir DIR; - splice(@files, 0, 2); # eliminate . and .. for ( @files ) { if ( /^_tags_(.*)\.txt$/ ) { next if ( $1 eq 'all' ); |