$user = twitter_fetchuser($nick);
if ($user) {
- $hookData['result'] = twitter_user_to_contact($user);
+ $hookData['result'] = twitter_user_to_contact($user) ?: null;
+ }
+
+ // Authoritative probe should set the result even if the probe was unsuccessful
+ if ($hookData['network'] == Protocol::TWITTER && empty($hookData['result'])) {
+ $hookData['result'] = [];
}
}
if ($b['preview']) {
$max_char = 280;
$item = $b['item'];
- $item['plink'] = DI::baseUrl()->get() . '/display/' . $item['guid'];
+ $item['plink'] = DI::baseUrl() . '/display/' . $item['guid'];
$condition = ['uri' => $item['thr-parent'], 'uid' => DI::userSession()->getLocalUserId()];
$orig_post = Post::selectFirst(['author-link'], $condition);
$application_name = DI::keyValue()->get('twitter_application_name') ?? '';
if ($application_name == '') {
- $application_name = DI::baseUrl()->getHostname();
+ $application_name = DI::baseUrl()->getHost();
}
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
$replacementList = [];
foreach ($status->entities->hashtags AS $hashtag) {
- $replace = '#[url=' . DI::baseUrl()->get() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]';
+ $replace = '#[url=' . DI::baseUrl() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]';
$taglist['#' . $hashtag->text] = ['#', $hashtag->text, ''];
$replacementList[$hashtag->indices[0]] = [
$application_name = DI::keyValue()->get('twitter_application_name') ?? '';
if ($application_name == '') {
- $application_name = DI::baseUrl()->getHostname();
+ $application_name = DI::baseUrl()->getHost();
}
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);