* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
* Maintainer: Hypolite Petovan <https://friendica.mrpetovan.com/profile/hypolite>
+ * Status: unsupported
*
* Copyright (c) 2011-2013 Tobias Diekershoff, Michael Vogel, Hypolite Petovan
* All rights reserved.
$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);
$osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
$lastid = DI::pConfig()->get($uid, 'twitter', 'lastid');
- $application_name = DI::keyValue()->get('twitter_application_name');
+ $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]] = [
Logger::info('Fetching timeline', ['uid' => $uid]);
- $application_name = DI::keyValue()->get('twitter_application_name');
+ $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);