缺少“名字”在某些用户的用户个人资料中
鉴于此代码:
$user_profile = $facebook->api('/me');
echo $user_profile['name'];
我看到某些用户出现以下错误:
PHP Notice: Undefined index: name
在什么情况下,名称会丢失?
更新:对于我没有名字的所有用户来说,一个共同点是他们的个人资料“链接”不起作用。当我访问它们时,我收到一个包含以下错误消息的页面:
The page you requested was not found.
You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive.
Return home
Go back to the previous page
Given this code:
$user_profile = $facebook->api('/me');
echo $user_profile['name'];
I see the following error for some users:
PHP Notice: Undefined index: name
Under what conditions, would the name be missing?
UPDATE: Something common with all the users for whom I do not have a name is that their profile "link" does not work. I get a page with the following error msg when I visit them:
The page you requested was not found.
You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive.
Return home
Go back to the previous page
Bug report for this:
http://developers.facebook.com/bugs/329979473681183
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,这些是企业帐户,并且它们没有可以可以通过 API 检索。
So it turns out that these were business accounts and they don't have names which can be retrieved via the API.
这可能与以下错误有关:
http://developers.facebook.com/bugs/297826446918182
http://developers.facebook.com/bugs/320132691332575
This might be related to these bugs:
http://developers.facebook.com/bugs/297826446918182
http://developers.facebook.com/bugs/320132691332575