[h1]Facebook Like Button "fb_xd_fragment" Bug[/h1]
受影響的有: Firefox 5.0+ + Safari + More Browsers...
根據 Facebook 的 Bugzilla 顯示,
直接 WONTFIX 代表他們根本不想修復這個問題。
http://bugs.developers.facebook.net/show_bug.cgi?id=9777
Status: CLOSED WONTFIX <-- Why?
引言回覆: |
------- Comment #69 From Jason 2011-06-14 14:23:40 PDT -------
Unfortunately there will not be a fix for this in the near term. Please work
around it if possible.
|
[hr]
[h2]Possible Workaround #1: Replace URI in your Script[/h2]
代碼:
/* At your head of script, try to filter the parameter away and redirect again */
if (isset($HTTP_GET_VARS['fb_xd_fragment']))
{
header('Location: http://'.$_SERVER['HTTP_HOST'].str_replace('?fb_xd_fragment=', '', $_SERVER['REQUEST_URI']), true);
exit;
}
[h2]Possible Workaround #2: Don't Display Like Button if detected[/h2]
代碼:
/* Like previous one, try NOT to add FB Like Button if fb_xd_fragment detected */
if (isset($HTTP_GET_VARS['fb_xd_fragment']))
{
$fb_button_fbxml = "<!-- workaround fb _xd_fragment bug //-->';
}
[h2]Possible Workaround #3: Using Redirect / ReWrite in Server Conf[/h2]
Using Redirect, Rewrite or RedirectMatch or something similar
http://httpd.apache.org/docs/2.0/mod/mod_alias.html
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.2/mod/mod_alias.html
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.3/mod/mod_alias.html
http://httpd.apache.org/docs/2.3/mod/mod_rewrite.html
_(2011-08-02 22:29)