[various] Adapt BaseURL calls for new UriInterface

This commit is contained in:
Philipp 2023-02-18 20:57:09 +01:00
parent 75df306424
commit 648fadedd3
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
30 changed files with 478 additions and 479 deletions

View file

@ -1100,7 +1100,7 @@ function twitter_prepare_body(array &$b)
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);
@ -1292,7 +1292,7 @@ function twitter_fetchtimeline(int $uid): void
$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);
@ -1694,7 +1694,7 @@ function twitter_expand_entities($body, stdClass $status)
$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]] = [
@ -2191,7 +2191,7 @@ function twitter_fetchhometimeline(int $uid): void
$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);