Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Contacts::Hotmail emails are not escaped and have some junk #21

Open
PavelTyk opened this Issue Sep 14, 2010 · 2 comments

Comments

Projects
None yet
2 participants

Emails are not HTML unescaped properly. There are junk at the end of the email address.

I just start using the contacts gem and I fixed it using "URI.unescape" and "split".

require 'uri'

Get your contacts:

type = "hotmail"
#test = Contacts.new(type, account, password)
#contacts = test.contacts rescue []

contacts = [
  ["someone",
   "some.email%40hotmail.com&ru=http%3a%2f%2fmpeople.live.com%2fdefault.aspx%3fpg%3d0"],
  ["someone2",
   "some.email2%40hotmail.com&ru=http%3a%2f%2fmpeople.live.com%2fdefault.aspx%3fpg%3d0"]
  ]

contacts.map! do | contact|
    [ contact[0], URI.unescape(contact[1].split("&")[0]) ]
end if ( type == 'hotmail')

contacts.each do |contact|
    puts "name : #{contact[0]} --> email: #{contact[1]}"
end

PavelTyk commented Apr 6, 2011

Well, I've found another solution for this. Take a look at my pull request:
#22

@kennethkalmer kennethkalmer added a commit to kennethkalmer/cardmagic-contacts that referenced this issue Dec 29, 2011

@PavelTyk @kennethkalmer PavelTyk + kennethkalmer Issue #21: Emails are HTML unescaped properly. Junk at the end of the…
… email address removed.
ca4295b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment