Search code examples
phpfacebookcodeigniter

Email address has app+gibberish when stored to database


While inspecting my database today, I noticed some records have gibberish format in the email field like this

app+9276ti5j64.ir10bj.618106aa6d78af59ff4c7f79f1bf

I noticed these records are all from Facebook Connect, though this is just a small percentage of other successful Facebook Connect. The email record is from

$me = $this->facebook->api('/me');
$email = $me['email'] 

If it fails to get it from Facebook, why does the email contains this gibberish string rather than NULL or empty ? (though for some reasons, fb_uid and other fields get passed normally)

Has anyone encountered the same problem? Is it Facebook Connect bug and what causes this?


Solution

  • It is special proxy facebook email.

    Before FB has changed connect window to what we how now - it was possible to select whether to send you back the real email, or a proxy one.

    If you had longer field length - you would see the whole proxy email, which though looks ugly is still perfect email and would just proxy emails to real user email (which you don't know).

    What to do now:

    1. Enlarge email field length. The valid length may be up to approximately 255 chars
    2. Deal some way with that garbage emails. Probably - re-request it from that users
    3. Feel free to use the same code as is - now it would always return real users' email