Prevent exceptions when Facebook apps post back in on themselves (occasianally duplicating fb_sig_user)

svn path=/trunk/facebook-sharp/; revision=89901
This commit is contained in:
R. Tyler Ballance 2007-11-18 18:20:07 +00:00
Родитель 351696144b
Коммит b9dd23d1f6
2 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace Mono.Facebook.Platform
{

Просмотреть файл

@ -217,8 +217,18 @@ namespace Mono.Facebook.Platform
{
throw new InvalidFacebookObjectException("You must first set the API Key for this application before calling RequireAdd()");
}
string fb_uid = source.Request.Params.Get("fb_sig_user");
string session_key = source.Request.Params.Get("fb_sig_session_key");
if (!String.IsNullOrEmpty(fb_uid))
{
// NOTE: Slightly nasty hack to handle Facebook occasionally double-posting the fb_sig_user parameter
// particularly on form submissions
string[] fb_uids = fb_uid.Split(new string[] {","}, StringSplitOptions.None);
fb_uid = fb_uids[0];
}
if (String.IsNullOrEmpty(session_key))
{
source.Response.Write(this.InstallHTML());
@ -238,8 +248,18 @@ namespace Mono.Facebook.Platform
{
throw new InvalidFacebookObjectException("You must first set the API Key for this application before calling RequireAdd()");
}
string fb_uid = source.Request.Params.Get("fb_sig_user");
string session_key = source.Request.Params.Get("fb_sig_session_key");
if (!String.IsNullOrEmpty(fb_uid))
{
// NOTE: Slightly nasty hack to handle Facebook occasionally double-posting the fb_sig_user parameter
// particularly on form submissions
string[] fb_uids = fb_uid.Split(new string[] {","}, StringSplitOptions.None);
fb_uid = fb_uids[0];
}
if (String.IsNullOrEmpty(session_key))
{
source.Response.Write(this.LoginHTML());