diff options
-rwxr-xr-x | lib/rbot/core/utils/wordlist.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rbot/core/utils/wordlist.rb b/lib/rbot/core/utils/wordlist.rb index 63cc99a7..875a9756 100755 --- a/lib/rbot/core/utils/wordlist.rb +++ b/lib/rbot/core/utils/wordlist.rb @@ -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 |