Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub getTopicNames {
- my $this = shift;
- my $dh;
- opendir( $dh, "$Foswiki::cfg{DataDir}/$this->{web}" )
- or return ();
- # the name filter is used to ensure we don't return filenames
- # that contain illegal characters as topic names.
- { use locale;
- my @topicList =
- map { /^(.*)\.txt$/; $1; }
- sort
- grep { !/$Foswiki::cfg{NameFilter}/ && /\.txt$/ } readdir($dh);
- }
- closedir($dh);
- return @topicList;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement