summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/intruder.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/intruder.rb b/app/models/intruder.rb
index db14bf8..8877c4c 100644
--- a/app/models/intruder.rb
+++ b/app/models/intruder.rb
@@ -18,10 +18,10 @@ class Intruder < ActiveRecord::Base
before_validation :set_key_if_empty
- def whois
- if ! self.contact_ip.blank?
+ def whois(ip_address = self.contact_ip)
+ if ! ip_address.blank?
begin
- return Whois.whois(self.contact_ip)
+ return Whois.whois(ip_address).to_s.gsub(/[^A-Za-z0-9\:\_\-\ \+\.\,\n]/, '')
rescue
return nil
end