summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/rbot/core/utils/wordlist.rb8
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