我有以下内容可以将文章发布到用户的 Facebook 提要。我遇到的问题是标题被帖子中未包含的字符包围:
{"O":文章标题"}
php 代码如下所示:
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if (isset($_POST['publish'])){
$comment = $_POST['comment'];
try {
$publishStream = $facebook->api("/$user/feed", 'post', array(
'message' => "I found this and wanted to share it",
'link' => $url,
'picture' => 'http://domain/images/image1.jpg',
'name' => $item_title,
'description'=> $comment
)
);
//as $_GET['publish'] is set so remove it by redirecting user to the base url
} catch (FacebookApiException $e) {
d($e);
}
这是我假设的链接项目有问题吗?我已将 $url 变量从数据库记录更改为固定字符串,但问题仍然存在。有任何想法吗?