Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. sub getTopicNames {
  2. my $this = shift;
  3. my $dh;
  4. opendir( $dh, "$Foswiki::cfg{DataDir}/$this->{web}" )
  5. or return ();
  6.  
  7. # the name filter is used to ensure we don't return filenames
  8. # that contain illegal characters as topic names.
  9. { use locale;
  10. my @topicList =
  11. map { /^(.*)\.txt$/; $1; }
  12. sort
  13. grep { !/$Foswiki::cfg{NameFilter}/ && /\.txt$/ } readdir($dh);
  14. }
  15. closedir($dh);
  16. return @topicList;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement