mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:10:11 +00:00
Move redundant System::baseUrl() to DI::baseUrl() calls
This commit is contained in:
parent
f2da1c5ab9
commit
3f34229752
81 changed files with 418 additions and 465 deletions
|
@ -303,7 +303,7 @@ class Contact
|
|||
*/
|
||||
public static function isLocal($url)
|
||||
{
|
||||
return Strings::compareLink(self::getBasepath($url, true), System::baseUrl());
|
||||
return Strings::compareLink(self::getBasepath($url, true), DI::baseUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -647,19 +647,19 @@ class Contact
|
|||
'self' => 1,
|
||||
'name' => $user['username'],
|
||||
'nick' => $user['nickname'],
|
||||
'photo' => System::baseUrl() . '/photo/profile/' . $user['uid'] . '.jpg',
|
||||
'thumb' => System::baseUrl() . '/photo/avatar/' . $user['uid'] . '.jpg',
|
||||
'micro' => System::baseUrl() . '/photo/micro/' . $user['uid'] . '.jpg',
|
||||
'photo' => DI::baseUrl() . '/photo/profile/' . $user['uid'] . '.jpg',
|
||||
'thumb' => DI::baseUrl() . '/photo/avatar/' . $user['uid'] . '.jpg',
|
||||
'micro' => DI::baseUrl() . '/photo/micro/' . $user['uid'] . '.jpg',
|
||||
'blocked' => 0,
|
||||
'pending' => 0,
|
||||
'url' => System::baseUrl() . '/profile/' . $user['nickname'],
|
||||
'nurl' => Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']),
|
||||
'addr' => $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3),
|
||||
'request' => System::baseUrl() . '/dfrn_request/' . $user['nickname'],
|
||||
'notify' => System::baseUrl() . '/dfrn_notify/' . $user['nickname'],
|
||||
'poll' => System::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
||||
'confirm' => System::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
||||
'poco' => System::baseUrl() . '/poco/' . $user['nickname'],
|
||||
'url' => DI::baseUrl() . '/profile/' . $user['nickname'],
|
||||
'nurl' => Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']),
|
||||
'addr' => $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3),
|
||||
'request' => DI::baseUrl() . '/dfrn_request/' . $user['nickname'],
|
||||
'notify' => DI::baseUrl() . '/dfrn_notify/' . $user['nickname'],
|
||||
'poll' => DI::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
||||
'confirm' => DI::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
||||
'poco' => DI::baseUrl() . '/poco/' . $user['nickname'],
|
||||
'name-date' => DateTimeFormat::utcNow(),
|
||||
'uri-date' => DateTimeFormat::utcNow(),
|
||||
'avatar-date' => DateTimeFormat::utcNow(),
|
||||
|
@ -722,7 +722,7 @@ class Contact
|
|||
// We are adding a timestamp value so that other systems won't use cached content
|
||||
$timestamp = strtotime($fields['avatar-date']);
|
||||
|
||||
$prefix = System::baseUrl() . '/photo/' .$avatar['resource-id'] . '-';
|
||||
$prefix = DI::baseUrl() . '/photo/' .$avatar['resource-id'] . '-';
|
||||
$suffix = '.' . $file_suffix . '?ts=' . $timestamp;
|
||||
|
||||
$fields['photo'] = $prefix . '4' . $suffix;
|
||||
|
@ -730,25 +730,25 @@ class Contact
|
|||
$fields['micro'] = $prefix . '6' . $suffix;
|
||||
} else {
|
||||
// We hadn't found a photo entry, so we use the default avatar
|
||||
$fields['photo'] = System::baseUrl() . '/images/person-300.jpg';
|
||||
$fields['thumb'] = System::baseUrl() . '/images/person-80.jpg';
|
||||
$fields['micro'] = System::baseUrl() . '/images/person-48.jpg';
|
||||
$fields['photo'] = DI::baseUrl() . '/images/person-300.jpg';
|
||||
$fields['thumb'] = DI::baseUrl() . '/images/person-80.jpg';
|
||||
$fields['micro'] = DI::baseUrl() . '/images/person-48.jpg';
|
||||
}
|
||||
|
||||
$fields['avatar'] = System::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix;
|
||||
$fields['avatar'] = DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix;
|
||||
$fields['forum'] = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||
$fields['prv'] = $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP;
|
||||
$fields['unsearchable'] = $user['hidewall'] || !$profile['net-publish'];
|
||||
|
||||
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
|
||||
$fields['url'] = System::baseUrl() . '/profile/' . $user['nickname'];
|
||||
$fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname'];
|
||||
$fields['nurl'] = Strings::normaliseLink($fields['url']);
|
||||
$fields['addr'] = $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$fields['request'] = System::baseUrl() . '/dfrn_request/' . $user['nickname'];
|
||||
$fields['notify'] = System::baseUrl() . '/dfrn_notify/' . $user['nickname'];
|
||||
$fields['poll'] = System::baseUrl() . '/dfrn_poll/'. $user['nickname'];
|
||||
$fields['confirm'] = System::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
|
||||
$fields['poco'] = System::baseUrl() . '/poco/' . $user['nickname'];
|
||||
$fields['addr'] = $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
$fields['request'] = DI::baseUrl() . '/dfrn_request/' . $user['nickname'];
|
||||
$fields['notify'] = DI::baseUrl() . '/dfrn_notify/' . $user['nickname'];
|
||||
$fields['poll'] = DI::baseUrl() . '/dfrn_poll/'. $user['nickname'];
|
||||
$fields['confirm'] = DI::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
|
||||
$fields['poco'] = DI::baseUrl() . '/poco/' . $user['nickname'];
|
||||
|
||||
$update = false;
|
||||
|
||||
|
@ -769,8 +769,8 @@ class Contact
|
|||
DBA::update('contact', $fields, ['uid' => 0, 'nurl' => $self['nurl']]);
|
||||
|
||||
// Update the profile
|
||||
$fields = ['photo' => System::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
|
||||
'thumb' => System::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
|
||||
$fields = ['photo' => DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
|
||||
'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
|
||||
DBA::update('profile', $fields, ['uid' => $uid, 'is-default' => true]);
|
||||
}
|
||||
}
|
||||
|
@ -1191,7 +1191,7 @@ class Contact
|
|||
$sparkle = false;
|
||||
if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
|
||||
$sparkle = true;
|
||||
$profile_link = System::baseUrl() . '/redir/' . $contact['id'];
|
||||
$profile_link = DI::baseUrl() . '/redir/' . $contact['id'];
|
||||
} else {
|
||||
$profile_link = $contact['url'];
|
||||
}
|
||||
|
@ -1207,19 +1207,19 @@ class Contact
|
|||
}
|
||||
|
||||
if (self::canReceivePrivateMessages($contact) && empty($contact['pending'])) {
|
||||
$pm_url = System::baseUrl() . '/message/new/' . $contact['id'];
|
||||
$pm_url = DI::baseUrl() . '/message/new/' . $contact['id'];
|
||||
}
|
||||
|
||||
if (($contact['network'] == Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
|
||||
$poke_link = System::baseUrl() . '/poke/?c=' . $contact['id'];
|
||||
$poke_link = DI::baseUrl() . '/poke/?c=' . $contact['id'];
|
||||
}
|
||||
|
||||
$contact_url = System::baseUrl() . '/contact/' . $contact['id'];
|
||||
$contact_url = DI::baseUrl() . '/contact/' . $contact['id'];
|
||||
|
||||
$posts_link = System::baseUrl() . '/contact/' . $contact['id'] . '/conversations';
|
||||
$posts_link = DI::baseUrl() . '/contact/' . $contact['id'] . '/conversations';
|
||||
|
||||
if (!$contact['self']) {
|
||||
$contact_drop_link = System::baseUrl() . '/contact/' . $contact['id'] . '/drop?confirm=1';
|
||||
$contact_drop_link = DI::baseUrl() . '/contact/' . $contact['id'] . '/drop?confirm=1';
|
||||
}
|
||||
|
||||
$follow_link = '';
|
||||
|
@ -2268,7 +2268,7 @@ class Contact
|
|||
if (($protocol === Protocol::DFRN) && !DBA::isResult($contact)) {
|
||||
if ($interactive) {
|
||||
if (strlen(DI::baseUrl()->getUrlPath())) {
|
||||
$myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']);
|
||||
$myaddr = bin2hex(DI::baseUrl() . '/profile/' . $a->user['nickname']);
|
||||
} else {
|
||||
$myaddr = bin2hex($a->user['nickname'] . '@' . DI::baseUrl()->getHostname());
|
||||
}
|
||||
|
@ -2594,7 +2594,7 @@ class Contact
|
|||
'to_name' => $user['username'],
|
||||
'to_email' => $user['email'],
|
||||
'uid' => $user['uid'],
|
||||
'link' => System::baseUrl() . '/notifications/intro',
|
||||
'link' => DI::baseUrl() . '/notifications/intro',
|
||||
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : L10n::t('[Name Withheld]')),
|
||||
'source_link' => $contact_record['url'],
|
||||
'source_photo' => $contact_record['photo'],
|
||||
|
|
|
@ -13,6 +13,7 @@ use Friendica\Core\PConfig;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Map;
|
||||
|
@ -589,9 +590,9 @@ class Event
|
|||
$copy = null;
|
||||
$drop = null;
|
||||
if (local_user() && local_user() == $event['uid'] && $event['type'] == 'event') {
|
||||
$edit = !$event['cid'] ? [System::baseUrl() . '/events/event/' . $event['id'], L10n::t('Edit event') , '', ''] : null;
|
||||
$copy = !$event['cid'] ? [System::baseUrl() . '/events/copy/' . $event['id'] , L10n::t('Duplicate event'), '', ''] : null;
|
||||
$drop = [System::baseUrl() . '/events/drop/' . $event['id'] , L10n::t('Delete event') , '', ''];
|
||||
$edit = !$event['cid'] ? [DI::baseUrl() . '/events/event/' . $event['id'], L10n::t('Edit event') , '', ''] : null;
|
||||
$copy = !$event['cid'] ? [DI::baseUrl() . '/events/copy/' . $event['id'] , L10n::t('Duplicate event'), '', ''] : null;
|
||||
$drop = [DI::baseUrl() . '/events/drop/' . $event['id'] , L10n::t('Delete event') , '', ''];
|
||||
}
|
||||
|
||||
$title = BBCode::convert(Strings::escapeHtml($event['summary']));
|
||||
|
|
|
@ -12,8 +12,8 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Protocol\PortableContact;
|
||||
|
@ -149,7 +149,7 @@ class GContact
|
|||
}
|
||||
|
||||
// The global contacts should contain the original picture, not the cached one
|
||||
if (($gcontact['generation'] != 1) && stristr(Strings::normaliseLink($gcontact['photo']), Strings::normaliseLink(System::baseUrl() . '/photo/'))) {
|
||||
if (($gcontact['generation'] != 1) && stristr(Strings::normaliseLink($gcontact['photo']), Strings::normaliseLink(DI::baseUrl() . '/photo/'))) {
|
||||
$gcontact['photo'] = '';
|
||||
}
|
||||
|
||||
|
@ -503,9 +503,9 @@ class GContact
|
|||
$done = [];
|
||||
|
||||
/// @TODO Check if it is really neccessary to poll the own server
|
||||
PortableContact::loadWorker(0, 0, 0, System::baseUrl() . '/poco');
|
||||
PortableContact::loadWorker(0, 0, 0, DI::baseUrl() . '/poco');
|
||||
|
||||
$done[] = System::baseUrl() . '/poco';
|
||||
$done[] = DI::baseUrl() . '/poco';
|
||||
|
||||
if (strlen(Config::get('system', 'directory'))) {
|
||||
$x = Network::fetchUrl(get_server() . '/pubsites');
|
||||
|
@ -1122,7 +1122,7 @@ class GContact
|
|||
"notify" => $userdata['notify'], 'url' => $userdata['url'],
|
||||
"hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
|
||||
'nick' => $userdata['nickname'], 'addr' => $userdata['addr'],
|
||||
"connect" => $userdata['addr'], "server_url" => System::baseUrl(),
|
||||
"connect" => $userdata['addr'], "server_url" => DI::baseUrl(),
|
||||
"generation" => 1, 'network' => Protocol::DFRN];
|
||||
|
||||
self::update($gcontact);
|
||||
|
@ -1182,7 +1182,7 @@ class GContact
|
|||
'addr' => $user->nickname . '@' . $hostname,
|
||||
'nick' => $user->nickname,
|
||||
"network" => Protocol::OSTATUS,
|
||||
'photo' => System::baseUrl() . '/images/person-300.jpg'];
|
||||
'photo' => DI::baseUrl() . '/images/person-300.jpg'];
|
||||
|
||||
if (isset($user->bio)) {
|
||||
$contact['about'] = $user->bio;
|
||||
|
|
|
@ -1564,7 +1564,7 @@ class Item
|
|||
$item['edited'] = DateTimeFormat::utcNow();
|
||||
}
|
||||
|
||||
$item['plink'] = ($item['plink'] ?? '') ?: System::baseUrl() . '/display/' . urlencode($item['guid']);
|
||||
$item['plink'] = ($item['plink'] ?? '') ?: DI::baseUrl() . '/display/' . urlencode($item['guid']);
|
||||
|
||||
$default = ['url' => $item['author-link'], 'name' => $item['author-name'],
|
||||
'photo' => $item['author-avatar'], 'network' => $item['network']];
|
||||
|
@ -2592,10 +2592,10 @@ class Item
|
|||
// All hashtags should point to the home server if "local_tags" is activated
|
||||
if (Config::get('system', 'local_tags')) {
|
||||
$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||
"#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
|
||||
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
|
||||
|
||||
$item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||
"#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["tag"]);
|
||||
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["tag"]);
|
||||
}
|
||||
|
||||
// mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
|
||||
|
@ -2624,7 +2624,7 @@ class Item
|
|||
}
|
||||
|
||||
$basetag = str_replace('_',' ',substr($tag,1));
|
||||
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||
$newtag = '#[url=' . DI::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||
|
||||
$item["body"] = str_replace($tag, $newtag, $item["body"]);
|
||||
|
||||
|
@ -2676,13 +2676,13 @@ class Item
|
|||
return false;
|
||||
}
|
||||
|
||||
$link = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']);
|
||||
$link = Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']);
|
||||
|
||||
/*
|
||||
* Diaspora uses their own hardwired link URL in @-tags
|
||||
* instead of the one we supply with webfinger
|
||||
*/
|
||||
$dlink = Strings::normaliseLink(System::baseUrl() . '/u/' . $user['nickname']);
|
||||
$dlink = Strings::normaliseLink(DI::baseUrl() . '/u/' . $user['nickname']);
|
||||
|
||||
$cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
|
@ -2852,7 +2852,7 @@ class Item
|
|||
}
|
||||
|
||||
Logger::log('check for photos', Logger::DEBUG);
|
||||
$site = substr(System::baseUrl(), strpos(System::baseUrl(), '://'));
|
||||
$site = substr(DI::baseUrl(), strpos(DI::baseUrl(), '://'));
|
||||
|
||||
$orig_body = $s;
|
||||
$new_body = '';
|
||||
|
|
|
@ -9,6 +9,7 @@ use Friendica\Core\L10n;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Database\DBA;
|
||||
|
@ -148,7 +149,7 @@ class Mail
|
|||
$recip_host = substr($recip_host, 0, strpos($recip_host, '/'));
|
||||
|
||||
$recip_handle = (($contact['addr']) ? $contact['addr'] : $contact['nick'] . '@' . $recip_host);
|
||||
$sender_handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$sender_handle = $a->user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
|
||||
$conv_guid = System::createUUID();
|
||||
$convuri = $recip_handle . ':' . $conv_guid;
|
||||
|
@ -214,7 +215,7 @@ class Mail
|
|||
$images = $match[1];
|
||||
if (count($images)) {
|
||||
foreach ($images as $image) {
|
||||
if (!stristr($image, System::baseUrl() . '/photo/')) {
|
||||
if (!stristr($image, DI::baseUrl() . '/photo/')) {
|
||||
continue;
|
||||
}
|
||||
$image_uri = substr($image, strrpos($image, '/') + 1);
|
||||
|
@ -262,7 +263,7 @@ class Mail
|
|||
|
||||
$conv_guid = System::createUUID();
|
||||
|
||||
$recip_handle = $recipient['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$recip_handle = $recipient['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
|
||||
$sender_nick = basename($replyto);
|
||||
$sender_host = substr($replyto, strpos($replyto, '://') + 3);
|
||||
|
|
|
@ -456,9 +456,9 @@ class Photo
|
|||
|
||||
$suffix = "?ts=" . time();
|
||||
|
||||
$image_url = System::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
|
||||
$thumb = System::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
|
||||
$micro = System::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
|
||||
$image_url = DI::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
|
||||
$thumb = DI::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
|
||||
$micro = DI::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
|
||||
|
||||
// Remove the cached photo
|
||||
$a = \get_app();
|
||||
|
@ -487,9 +487,9 @@ class Photo
|
|||
}
|
||||
|
||||
if ($photo_failure) {
|
||||
$image_url = System::baseUrl() . "/images/person-300.jpg";
|
||||
$thumb = System::baseUrl() . "/images/person-80.jpg";
|
||||
$micro = System::baseUrl() . "/images/person-48.jpg";
|
||||
$image_url = DI::baseUrl() . "/images/person-300.jpg";
|
||||
$thumb = DI::baseUrl() . "/images/person-80.jpg";
|
||||
$micro = DI::baseUrl() . "/images/person-48.jpg";
|
||||
}
|
||||
|
||||
return [$image_url, $thumb, $micro];
|
||||
|
@ -622,7 +622,7 @@ class Photo
|
|||
}
|
||||
|
||||
foreach ($images as $image) {
|
||||
if (!stristr($image, System::baseUrl() . '/photo/')) {
|
||||
if (!stristr($image, DI::baseUrl() . '/photo/')) {
|
||||
continue;
|
||||
}
|
||||
$image_uri = substr($image,strrpos($image,'/') + 1);
|
||||
|
|
|
@ -20,8 +20,6 @@ use Friendica\Core\Protocol;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Theme;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
|
@ -396,7 +394,7 @@ class Profile
|
|||
// show edit profile to yourself
|
||||
if (!$is_contact && $local_user_is_self) {
|
||||
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
|
||||
$r = q(
|
||||
"SELECT * FROM `profile` WHERE `uid` = %d",
|
||||
local_user()
|
||||
|
@ -422,7 +420,7 @@ class Profile
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['menu'] = [
|
||||
'chg_photo' => L10n::t('Change profile photo'),
|
||||
'cr_new' => null,
|
||||
|
@ -461,7 +459,7 @@ class Profile
|
|||
if (!empty($profile['guid'])) {
|
||||
$diaspora = [
|
||||
'guid' => $profile['guid'],
|
||||
'podloc' => System::baseUrl(),
|
||||
'podloc' => DI::baseUrl(),
|
||||
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false'),
|
||||
'nickname' => $profile['nickname'],
|
||||
'fullname' => $profile['name'],
|
||||
|
@ -879,7 +877,7 @@ class Profile
|
|||
}
|
||||
|
||||
if ($a->profile['uid'] == local_user()) {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
}
|
||||
|
||||
return Renderer::replaceMacros($tpl, [
|
||||
|
@ -907,7 +905,7 @@ class Profile
|
|||
$nickname = $a->user['nickname'];
|
||||
}
|
||||
|
||||
$baseProfileUrl = System::baseUrl() . '/profile/' . $nickname;
|
||||
$baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
|
||||
|
||||
$tabs = [
|
||||
[
|
||||
|
@ -928,7 +926,7 @@ class Profile
|
|||
],
|
||||
[
|
||||
'label' => L10n::t('Photos'),
|
||||
'url' => System::baseUrl() . '/photos/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/photos/' . $nickname,
|
||||
'sel' => $current == 'photos' ? 'active' : '',
|
||||
'title' => L10n::t('Photo Albums'),
|
||||
'id' => 'photo-tab',
|
||||
|
@ -936,7 +934,7 @@ class Profile
|
|||
],
|
||||
[
|
||||
'label' => L10n::t('Videos'),
|
||||
'url' => System::baseUrl() . '/videos/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/videos/' . $nickname,
|
||||
'sel' => $current == 'videos' ? 'active' : '',
|
||||
'title' => L10n::t('Videos'),
|
||||
'id' => 'video-tab',
|
||||
|
@ -948,7 +946,7 @@ class Profile
|
|||
if ($is_owner && $a->theme_events_in_profile) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Events'),
|
||||
'url' => System::baseUrl() . '/events',
|
||||
'url' => DI::baseUrl() . '/events',
|
||||
'sel' => $current == 'events' ? 'active' : '',
|
||||
'title' => L10n::t('Events and Calendar'),
|
||||
'id' => 'events-tab',
|
||||
|
@ -959,7 +957,7 @@ class Profile
|
|||
} elseif (!$is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Events'),
|
||||
'url' => System::baseUrl() . '/cal/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/cal/' . $nickname,
|
||||
'sel' => $current == 'cal' ? 'active' : '',
|
||||
'title' => L10n::t('Events and Calendar'),
|
||||
'id' => 'events-tab',
|
||||
|
@ -970,7 +968,7 @@ class Profile
|
|||
if ($is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Personal Notes'),
|
||||
'url' => System::baseUrl() . '/notes',
|
||||
'url' => DI::baseUrl() . '/notes',
|
||||
'sel' => $current == 'notes' ? 'active' : '',
|
||||
'title' => L10n::t('Only You Can See This'),
|
||||
'id' => 'notes-tab',
|
||||
|
@ -981,7 +979,7 @@ class Profile
|
|||
if (!empty($_SESSION['new_member']) && $is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Tips for New Members'),
|
||||
'url' => System::baseUrl() . '/newmember',
|
||||
'url' => DI::baseUrl() . '/newmember',
|
||||
'sel' => false,
|
||||
'title' => L10n::t('Tips for New Members'),
|
||||
'id' => 'newmember-tab',
|
||||
|
|
|
@ -6,8 +6,8 @@ namespace Friendica\Model;
|
|||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
|
@ -208,7 +208,7 @@ class Term
|
|||
*/
|
||||
public static function insertFromTagFieldByItemId($item_id, $tag_str)
|
||||
{
|
||||
$profile_base = System::baseUrl();
|
||||
$profile_base = DI::baseUrl();
|
||||
$profile_data = parse_url($profile_base);
|
||||
$profile_path = $profile_data['path'] ?? '';
|
||||
$profile_base_friendica = $profile_data['host'] . $profile_path . '/profile/';
|
||||
|
@ -425,7 +425,7 @@ class Term
|
|||
'implicit_mentions' => [],
|
||||
];
|
||||
|
||||
$searchpath = System::baseUrl() . "/search?tag=";
|
||||
$searchpath = DI::baseUrl() . "/search?tag=";
|
||||
|
||||
$taglist = DBA::select(
|
||||
'term',
|
||||
|
|
|
@ -217,12 +217,12 @@ class User
|
|||
// Check if the returned data is valid, otherwise fix it. See issue #6122
|
||||
|
||||
// Check for correct url and normalised nurl
|
||||
$url = System::baseUrl() . '/profile/' . $r['nickname'];
|
||||
$url = DI::baseUrl() . '/profile/' . $r['nickname'];
|
||||
$repair = ($r['url'] != $url) || ($r['nurl'] != Strings::normaliseLink($r['url']));
|
||||
|
||||
if (!$repair) {
|
||||
// Check if "addr" is present and correct
|
||||
$addr = $r['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$addr = $r['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
$repair = ($addr != $r['addr']);
|
||||
}
|
||||
|
||||
|
@ -635,7 +635,7 @@ class User
|
|||
|
||||
$openid = new LightOpenID(DI::baseUrl()->getHostname());
|
||||
$openid->identity = $openid_url;
|
||||
$openid->returnUrl = System::baseUrl() . '/openid';
|
||||
$openid->returnUrl = DI::baseUrl() . '/openid';
|
||||
$openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
|
||||
$openid->optional = ['namePerson/first', 'media/image/aspect11', 'media/image/default'];
|
||||
try {
|
||||
|
@ -782,8 +782,8 @@ class User
|
|||
$insert_result = DBA::insert('profile', [
|
||||
'uid' => $uid,
|
||||
'name' => $username,
|
||||
'photo' => System::baseUrl() . "/photo/profile/{$uid}.jpg",
|
||||
'thumb' => System::baseUrl() . "/photo/avatar/{$uid}.jpg",
|
||||
'photo' => DI::baseUrl() . "/photo/profile/{$uid}.jpg",
|
||||
'thumb' => DI::baseUrl() . "/photo/avatar/{$uid}.jpg",
|
||||
'publish' => $publish,
|
||||
'is-default' => 1,
|
||||
'net-publish' => $netpublish,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue