suddenly, getUser became to return 0.(PHP 3.1.1 SDK)

我的未来我决定 提交于 2019-11-29 18:38:41

问题


Only 10 hours ago, if I call $facebook->getUser(), I can get the correct user_id, but now, it always returns 0. Of cource, I have not changed my code.

There is another strange point.

redirect_url contains:

?sate=9b1772342342...&code=9b177asd2l..&base_domain=9b1772.3423#=

I can't release the site.. Please help!


回答1:


I think this is a Facebook bug, I just finished figuring it out myself. You need to alter the Base_Facebook class, and add in a new query param to strip out. The base_domain param is being accidentally appended to the redirect url, hopefully a fix will be rolled out soon.

  /**
   * List of query parameters that get automatically dropped when rebuilding
   * the current URL.
   */
  protected static $DROP_QUERY_PARAMS = array(
    'code',
    'state',
    'signed_request',
    'base_domain', // this is the one you need to add
  );


来源:https://stackoverflow.com/questions/8587098/suddenly-getuser-became-to-return-0-php-3-1-1-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!