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:
Родитель
351696144b
Коммит
b9dd23d1f6
|
@ -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());
|
||||
|
|
Загрузка…
Ссылка в новой задаче