]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/core/utils/wordlist.rb
wordlist: exist? method
[user/henk/code/ruby/rbot.git] / lib / rbot / core / utils / wordlist.rb
index 63cc99a7c8808e04200f3b0b863e3ee8950d5f8f..875a975695e09c4dca78daa0d7487a253d5727b3 100755 (executable)
@@ -52,6 +52,14 @@ class Wordlist
       name[striplen..-1]
     }
   end
+
+  def self.exist?(path)
+    fn = path.to_s
+    # refuse to check outside of the wordlist base directory
+    return false if fn =~ /\.\.\//
+    File.exist?(File.join(self.wordlist_base, fn))
+  end
+
 end
 end
 end