support [dot] conversion in authors' emails

git-svn-id: file:///home/svn/framework3/trunk@6151 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
kris 2009-01-14 15:17:03 +00:00
parent cb327d40fc
commit 2e4edcaa83
1 changed files with 4 additions and 6 deletions

View File

@ -88,21 +88,19 @@ class Msf::Module::Author
# Supported formats: # Supported formats:
# known_name # known_name
# user@host.tld # user [at/@] host [dot/.] tld
# Name <user@host.rld> # Name <user [at/@] host [dot/.] tld>
# user[at]host.tld
# Name <user [at] host.tld>
if ((m = str.match(/^\s*([^<]+)<([^>]+)>\s*$/))) if ((m = str.match(/^\s*([^<]+)<([^>]+)>\s*$/)))
self.name = m[1].sub(/<.*/, '') self.name = m[1].sub(/<.*/, '')
self.email = m[2].sub(/\s*\[at\]\s*/, '@') self.email = m[2].sub(/\s*\[at\]\s*/, '@').sub(/\s*\[dot\]\s*/, '.')
else else
if (Known[str]) if (Known[str])
self.email = Known[str] self.email = Known[str]
self.name = str self.name = str
else else
self.email = str.sub(/\s*\[at\]\s*/, '@').gsub(/^<|>$/, '') self.email = str.sub(/\s*\[at\]\s*/, '@').sub(/\s*\[dot\]\s*/, '.').gsub(/^<|>$/, '')
m = self.email.match(/([^@]+)@/) m = self.email.match(/([^@]+)@/)
self.name = m ? m[1] : 'unknown' self.name = m ? m[1] : 'unknown'
end end