Adapt BaseURL calls to new UriInterface

This commit is contained in:
Philipp 2023-02-18 20:57:30 +01:00
parent 9e6d95284b
commit f0c29edcde
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
101 changed files with 218 additions and 241 deletions

View file

@ -136,7 +136,7 @@ class FormattedNavNotification extends BaseFactory
self::$contacts[$notification->actorId]['url'],
$message['notification'],
$notification->created,
new Uri($this->baseUrl->get() . '/notification/' . $notification->id),
new Uri($this->baseUrl . '/notification/' . $notification->id),
$notification->seen,
);
}
@ -168,7 +168,7 @@ class FormattedNavNotification extends BaseFactory
self::$contacts[$intro->cid]['url'],
$msg,
$intro->datetime,
new Uri($this->baseUrl->get() . '/notifications/intros/' . $intro->id)
new Uri($this->baseUrl . '/notifications/intros/' . $intro->id)
);
}
}

View file

@ -90,7 +90,7 @@ class FormattedNotify extends BaseFactory
case Activity::LIKE:
return new ValueObject\FormattedNotify(
'like',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s liked %s's post", $formattedItem['author-name'], $formattedItem['parent-author-name']),
@ -102,7 +102,7 @@ class FormattedNotify extends BaseFactory
case Activity::DISLIKE:
return new ValueObject\FormattedNotify(
'dislike',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s disliked %s's post", $formattedItem['author-name'], $formattedItem['parent-author-name']),
@ -114,7 +114,7 @@ class FormattedNotify extends BaseFactory
case Activity::ATTEND:
return new ValueObject\FormattedNotify(
'attend',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s is attending %s's event", $formattedItem['author-name'], $formattedItem['parent-author-name']),
@ -126,7 +126,7 @@ class FormattedNotify extends BaseFactory
case Activity::ATTENDNO:
return new ValueObject\FormattedNotify(
'attendno',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s is not attending %s's event", $formattedItem['author-name'], $formattedItem['parent-author-name']),
@ -138,7 +138,7 @@ class FormattedNotify extends BaseFactory
case Activity::ATTENDMAYBE:
return new ValueObject\FormattedNotify(
'attendmaybe',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s may attending %s's event", $formattedItem['author-name'], $formattedItem['parent-author-name']),
@ -168,7 +168,7 @@ class FormattedNotify extends BaseFactory
return new ValueObject\FormattedNotify(
'friend',
$this->baseUrl->get(true) . '/display/' . $formattedItem['parent-guid'],
$this->baseUrl . '/display/' . $formattedItem['parent-guid'],
$formattedItem['author-avatar'],
$formattedItem['author-link'],
$this->l10n->t("%s is now friends with %s", $formattedItem['author-name'], $formattedItem['fname']),
@ -219,7 +219,7 @@ class FormattedNotify extends BaseFactory
foreach ($Notifies as $Notify) {
$formattedNotifications[] = new ValueObject\FormattedNotify(
'notification',
$this->baseUrl->get(true) . '/notify/' . $Notify->id,
$this->baseUrl . '/notify/' . $Notify->id,
Contact::getAvatarUrlForUrl($Notify->url, $Notify->uid, Proxy::SIZE_MICRO),
$Notify->url,
strip_tags(BBCode::toPlaintext($Notify->msg)),
@ -369,7 +369,7 @@ class FormattedNotify extends BaseFactory
}
$item['label'] = (($item['gravity'] == Item::GRAVITY_PARENT) ? 'post' : 'comment');
$item['link'] = $this->baseUrl->get(true) . '/display/' . $item['parent-guid'];
$item['link'] = $this->baseUrl . '/display/' . $item['parent-guid'];
$item['image'] = $item['author-avatar'];
$item['url'] = $item['author-link'];
$item['when'] = DateTimeFormat::local($item['created'], 'r');

View file

@ -125,8 +125,8 @@ class Introduction extends BaseFactory
continue;
}
$return_addr = bin2hex($this->nick . '@' .
$this->baseUrl->getHostname() .
(($this->baseUrl->getUrlPath()) ? '/' . $this->baseUrl->getUrlPath() : ''));
$this->baseUrl->getHost() .
(($this->baseUrl->getPath()) ? '/' . $this->baseUrl->getPath() : ''));
$formattedIntroductions[] = new ValueObject\Introduction([
'label' => 'friend_suggestion',

View file

@ -264,7 +264,7 @@ class Notify extends BaseRepository
}
}
$siteurl = $this->baseUrl->get(true);
$siteurl = $this->baseUrl;
$sitename = $this->config->get('config', 'sitename');
// with $params['show_in_notification_page'] == false, the notification isn't inserted into
@ -539,7 +539,7 @@ class Notify extends BaseRepository
$nickname = $user['nickname'];
$hostname = $this->baseUrl->getHostname();
$hostname = $this->baseUrl->getHost();
if (strpos($hostname, ':')) {
$hostname = substr($hostname, 0, strpos($hostname, ':'));
}
@ -590,7 +590,7 @@ class Notify extends BaseRepository
$Notify->updateMsgFromPreamble($epreamble);
$Notify = $this->save($Notify);
$itemlink = $this->baseUrl->get() . '/notify/' . $Notify->id;
$itemlink = $this->baseUrl . '/notify/' . $Notify->id;
$notify_id = $Notify->id;
}
@ -747,7 +747,7 @@ class Notify extends BaseRepository
$params['item'] = $item;
$params['parent'] = $item['parent'];
$params['link'] = $this->baseUrl->get() . '/display/' . urlencode($item['guid']);
$params['link'] = $this->baseUrl . '/display/' . urlencode($item['guid']);
$subjectPrefix = $l10n->t('[Friendica:Notify]');
@ -807,7 +807,7 @@ class Notify extends BaseRepository
$epreamble = $msg['rich'];
$sitename = $this->config->get('config', 'sitename');
$siteurl = $this->baseUrl->get(true);
$siteurl = $this->baseUrl;
$sitelink = $l10n->t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl);