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

@ -56,7 +56,7 @@ class Objects extends BaseModule
Logger::info('Provided GUID found.', ['guid' => $this->parameters['guid'], 'uri-id' => $itemuri['id']]);
} else {
// The item URI does not always contain the GUID. This means that we have to search the URL instead
$url = DI::baseUrl()->get() . '/' . DI::args()->getQueryString();
$url = DI::baseUrl() . '/' . DI::args()->getQueryString();
$nurl = Strings::normaliseLink($url);
$ssl_url = str_replace('http://', 'https://', $nurl);

View file

@ -112,7 +112,7 @@ class Details extends BaseAdmin
'$page' => DI::l10n()->t('Addons'),
'$toggle' => DI::l10n()->t('Toggle'),
'$settings' => DI::l10n()->t('Settings'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$addon' => $addon,
'$status' => $status,

View file

@ -68,7 +68,7 @@ class Index extends BaseAdmin
'$page' => DI::l10n()->t('Addons'),
'$submit' => DI::l10n()->t('Save Settings'),
'$reload' => DI::l10n()->t('Reload active addons'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$function' => 'addons',
'$addons' => $addons,
'$pcount' => count($addons),

View file

@ -102,13 +102,13 @@ class DBSync extends BaseAdmin
if (!count($failed)) {
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/structure_check.tpl'), [
'$base' => DI::baseUrl()->get(true),
'$base' => DI::baseUrl(),
'$banner' => DI::l10n()->t('No failed updates.'),
'$check' => DI::l10n()->t('Check database structure'),
]);
} else {
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/failed_updates.tpl'), [
'$base' => DI::baseUrl()->get(true),
'$base' => DI::baseUrl(),
'$banner' => DI::l10n()->t('Failed Updates'),
'$desc' => DI::l10n()->t('This does not include updates prior to 1139, which did not return a status.'),
'$mark' => DI::l10n()->t("Mark success \x28if update was manually applied\x29"),

View file

@ -81,7 +81,7 @@ class Features extends BaseAdmin
$tpl = Renderer::getMarkupTemplate('admin/features.tpl');
$o = Renderer::replaceMacros($tpl, [
'$form_security_token' => self::getFormSecurityToken("admin_manage_features"),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$title' => DI::l10n()->t('Manage Additional Features'),
'$features' => $features,
'$submit' => DI::l10n()->t('Save Settings'),

View file

@ -80,7 +80,7 @@ class Settings extends BaseAdmin
'$page' => DI::l10n()->t('Logs'),
'$submit' => DI::l10n()->t('Save Settings'),
'$clear' => DI::l10n()->t('Clear'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$logname' => DI::config()->get('system', 'logfile'),
// see /help/smarty3-templates#1_1 on any Friendica node
'$debugging' => ['debugging', DI::l10n()->t("Enable Debugging"), DI::config()->get('system', 'debugging'), ""],

View file

@ -80,7 +80,7 @@ class View extends BaseAdmin
}
}
return Renderer::replaceMacros($t, [
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('View Logs'),
'$l10n' => [

View file

@ -118,7 +118,6 @@ class Site extends BaseAdmin
$mail_enabled = !empty($_POST['mail_enabled']);
$ostatus_enabled = !empty($_POST['ostatus_enabled']);
$diaspora_enabled = !empty($_POST['diaspora_enabled']);
$ssl_policy = (!empty($_POST['ssl_policy']) ? intval($_POST['ssl_policy']) : 0);
$force_ssl = !empty($_POST['force_ssl']);
$show_help = !empty($_POST['show_help']);
$dbclean = !empty($_POST['dbclean']);
@ -152,49 +151,10 @@ class Site extends BaseAdmin
Worker::add(Worker::PRIORITY_LOW, 'Directory');
}
if (DI::baseUrl()->getUrlPath() != "") {
if (DI::baseUrl()->getPath() != "") {
$diaspora_enabled = false;
}
if ($ssl_policy != intval(DI::config()->get('system', 'ssl_policy'))) {
if ($ssl_policy == App\BaseURL::SSL_POLICY_FULL) {
DBA::e("UPDATE `contact` SET
`url` = REPLACE(`url` , 'http:' , 'https:'),
`photo` = REPLACE(`photo` , 'http:' , 'https:'),
`thumb` = REPLACE(`thumb` , 'http:' , 'https:'),
`micro` = REPLACE(`micro` , 'http:' , 'https:'),
`request` = REPLACE(`request`, 'http:' , 'https:'),
`notify` = REPLACE(`notify` , 'http:' , 'https:'),
`poll` = REPLACE(`poll` , 'http:' , 'https:'),
`confirm` = REPLACE(`confirm`, 'http:' , 'https:'),
`poco` = REPLACE(`poco` , 'http:' , 'https:')
WHERE `self` = 1"
);
DBA::e("UPDATE `profile` SET
`photo` = REPLACE(`photo` , 'http:' , 'https:'),
`thumb` = REPLACE(`thumb` , 'http:' , 'https:')
WHERE 1 "
);
} elseif ($ssl_policy == App\BaseURL::SSL_POLICY_SELFSIGN) {
DBA::e("UPDATE `contact` SET
`url` = REPLACE(`url` , 'https:' , 'http:'),
`photo` = REPLACE(`photo` , 'https:' , 'http:'),
`thumb` = REPLACE(`thumb` , 'https:' , 'http:'),
`micro` = REPLACE(`micro` , 'https:' , 'http:'),
`request` = REPLACE(`request`, 'https:' , 'http:'),
`notify` = REPLACE(`notify` , 'https:' , 'http:'),
`poll` = REPLACE(`poll` , 'https:' , 'http:'),
`confirm` = REPLACE(`confirm`, 'https:' , 'http:'),
`poco` = REPLACE(`poco` , 'https:' , 'http:')
WHERE `self` = 1"
);
DBA::e("UPDATE `profile` SET
`photo` = REPLACE(`photo` , 'https:' , 'http:'),
`thumb` = REPLACE(`thumb` , 'https:' , 'http:')
WHERE 1 "
);
}
}
$transactionConfig->set('system', 'ssl_policy' , $ssl_policy);
$transactionConfig->set('system', 'maxloadavg' , $maxloadavg);
$transactionConfig->set('system', 'min_memory' , $min_memory);
$transactionConfig->set('system', 'optimize_tables' , $optimize_tables);
@ -408,12 +368,6 @@ class Site extends BaseAdmin
Register::OPEN => DI::l10n()->t('Open')
];
$ssl_choices = [
App\BaseURL::SSL_POLICY_NONE => DI::l10n()->t('No SSL policy, links will track page SSL state'),
App\BaseURL::SSL_POLICY_FULL => DI::l10n()->t('Force all links to use SSL'),
App\BaseURL::SSL_POLICY_SELFSIGN => DI::l10n()->t('Self-signed certificate, use SSL for local links only (discouraged)')
];
$check_git_version_choices = [
'none' => DI::l10n()->t('Don\'t check'),
'stable' => DI::l10n()->t('check the stable version'),
@ -428,7 +382,7 @@ class Site extends BaseAdmin
// ContactRelation::DISCOVERY_ALL => DI::l10n()->t('All'),
];
$diaspora_able = (DI::baseUrl()->getUrlPath() == '');
$diaspora_able = (DI::baseUrl()->getPath() == '');
$t = Renderer::getMarkupTemplate('admin/site.tpl');
return Renderer::replaceMacros($t, [
@ -452,7 +406,7 @@ class Site extends BaseAdmin
'$relocate' => DI::l10n()->t('Relocate Node'),
'$relocate_msg' => DI::l10n()->t('Relocating your node enables you to change the DNS domain of this node and keep all the existing users and posts. This process takes a while and can only be started from the relocate console command like this:'),
'$relocate_cmd' => DI::l10n()->t('(Friendica directory)# bin/console relocate https://newdomain.com'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
// name, label, value, help string, extra data...
'$sitename' => ['sitename', DI::l10n()->t('Site name'), DI::config()->get('config', 'sitename'), ''],
@ -464,9 +418,8 @@ class Site extends BaseAdmin
'$touch_icon' => ['touch_icon', DI::l10n()->t('Touch icon'), DI::config()->get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')],
'$additional_info' => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
'$language' => ['language', DI::l10n()->t('System language'), DI::config()->get('system', 'language'), '', $lang_choices],
'$theme' => ['theme', DI::l10n()->t('System theme'), DI::config()->get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="%s" id="cnftheme">Change default theme settings</a>', DI::baseUrl()->get(true) . '/admin/themes'), $theme_choices],
'$theme' => ['theme', DI::l10n()->t('System theme'), DI::config()->get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="%s" id="cnftheme">Change default theme settings</a>', DI::baseUrl() . '/admin/themes'), $theme_choices],
'$theme_mobile' => ['theme_mobile', DI::l10n()->t('Mobile system theme'), DI::config()->get('system', 'mobile-theme', '---'), DI::l10n()->t('Theme for mobile devices'), $theme_choices_mobile],
'$ssl_policy' => ['ssl_policy', DI::l10n()->t('SSL link policy'), DI::config()->get('system', 'ssl_policy'), DI::l10n()->t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
'$force_ssl' => ['force_ssl', DI::l10n()->t('Force SSL'), DI::config()->get('system', 'force_ssl'), DI::l10n()->t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
'$show_help' => ['show_help', DI::l10n()->t('Show help entry from navigation menu'), !DI::config()->get('system', 'hide_help'), DI::l10n()->t('Displays the menu entry for the Help pages from the navigation menu. It is always accessible by calling /help directly.')],
'$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), DI::config()->get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names],

View file

@ -144,7 +144,7 @@ class Storage extends BaseAdmin
'$use' => DI::l10n()->t('Use storage backend'),
'$save_reload' => DI::l10n()->t('Save & Reload'),
'$noconfig' => DI::l10n()->t('This backend doesn\'t have custom settings'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$form_security_token' => self::getFormSecurityToken("admin_storage"),
'$storagebackend' => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
'$availablestorageforms' => $available_storage_forms,

View file

@ -107,18 +107,18 @@ class Summary extends BaseAdmin
// Legacy config file warning
if (file_exists('.htconfig.php')) {
$warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>.htconfig.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
$warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>.htconfig.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl() . '/help/Config');
}
if (file_exists('config/local.ini.php')) {
$warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
$warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl() . '/help/Config');
}
// Check server vitality
if (!self::checkSelfHostMeta()) {
$well_known = DI::baseUrl()->get() . Probe::HOST_META;
$well_known = DI::baseUrl() . Probe::HOST_META;
$warningtext[] = DI::l10n()->t('<a href="%s">%s</a> is not reachable on your system. This is a severe configuration issue that prevents server to server communication. See <a href="%s">the installation page</a> for help.',
$well_known, $well_known, DI::baseUrl()->get() . '/help/Install');
$well_known, $well_known, DI::baseUrl() . '/help/Install');
}
// Check logfile permission
@ -229,7 +229,7 @@ class Summary extends BaseAdmin
private static function checkSelfHostMeta()
{
// Fetch the host-meta to check if this really is a vital server
return DI::httpClient()->get(DI::baseUrl()->get() . Probe::HOST_META, HttpClientAccept::XRD_XML)->isSuccess();
return DI::httpClient()->get(DI::baseUrl() . Probe::HOST_META, HttpClientAccept::XRD_XML)->isSuccess();
}
}

View file

@ -76,7 +76,7 @@ class Details extends BaseAdmin
require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin')) {
$admin_form = '<iframe onload="resizeIframe(this);" src="' . DI::baseUrl()->get(true) . '/admin/themes/' . $theme . '/embed?mode=minimal" width="100%" height="600px" frameborder="no"></iframe>';
$admin_form = '<iframe onload="resizeIframe(this);" src="' . DI::baseUrl() . '/admin/themes/' . $theme . '/embed?mode=minimal" width="100%" height="600px" frameborder="no"></iframe>';
}
}
@ -91,7 +91,7 @@ class Details extends BaseAdmin
'$page' => DI::l10n()->t('Themes'),
'$toggle' => DI::l10n()->t('Toggle'),
'$settings' => DI::l10n()->t('Settings'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$addon' => $theme,
'$status' => $status,
'$action' => $action,

View file

@ -95,7 +95,7 @@ class Embed extends BaseAdmin
$t = Renderer::getMarkupTemplate('admin/addons/embed.tpl');
return Renderer::replaceMacros($t, [
'$action' => DI::baseUrl()->get(true) . '/admin/themes/' . $theme . '/embed?mode=minimal',
'$action' => DI::baseUrl() . '/admin/themes/' . $theme . '/embed?mode=minimal',
'$form' => $admin_form,
'$form_security_token' => self::getFormSecurityToken("admin_theme_settings"),
]);

View file

@ -112,7 +112,7 @@ class Index extends BaseAdmin
'$page' => DI::l10n()->t('Themes'),
'$submit' => DI::l10n()->t('Save Settings'),
'$reload' => DI::l10n()->t('Reload active themes'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$function' => 'themes',
'$addons' => $addons,
'$pcount' => count($themes),

View file

@ -37,9 +37,9 @@ class Config extends BaseApi
$config = [
'site' => [
'name' => DI::config()->get('config', 'sitename'),
'server' => DI::baseUrl()->getHostname(),
'server' => DI::baseUrl()->getHost(),
'theme' => DI::config()->get('system', 'theme'),
'path' => DI::baseUrl()->getUrlPath(),
'path' => DI::baseUrl()->getPath(),
'logo' => DI::baseUrl() . '/images/friendica-64.png',
'fancy' => true,
'language' => DI::config()->get('system', 'language'),
@ -52,7 +52,7 @@ class Config extends BaseApi
'private' => (bool)DI::config()->get('system', 'block_public'),
'textlimit' => (string) DI::config()->get('config', 'api_import_size', DI::config()->get('config', 'max_import_size')),
'sslserver' => null,
'ssl' => DI::config()->get('system', 'ssl_policy') == App\BaseURL::SSL_POLICY_FULL ? 'always' : '0',
'ssl' => DI::baseUrl()->getScheme() === 'https' ? 'always' : '0',
'friendica' => [
'FRIENDICA_PLATFORM' => App::PLATFORM,
'FRIENDICA_VERSION' => App::VERSION,

View file

@ -62,7 +62,7 @@ abstract class ContactEndpoint extends BaseApi
if (!$screen_name) {
$contact = Contact::getById($contact_id, ['nick', 'url']);
// We don't have the followers of remote accounts so we check for locality
if (empty($contact) || !Strings::startsWith($contact['url'], DI::baseUrl()->get())) {
if (empty($contact) || !Strings::startsWith($contact['url'], DI::baseUrl())) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Contact not found'));
}

View file

@ -59,7 +59,7 @@ class Download extends \Friendica\BaseModule
header('Content-Type: text/csv');
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename="' . $this->baseUrl->getHostname() . '_domain_blocklist_' . substr($hash, 0, 6) . '.csv"');
header('Content-disposition: attachment; filename="' . $this->baseUrl->getHost() . '_domain_blocklist_' . substr($hash, 0, 6) . '.csv"');
header("Etag: $etag");
$this->blocklist->exportToFile('php://output');

View file

@ -47,7 +47,7 @@ class Bookmarklet extends BaseModule
}
$referer = Strings::normaliseLink($_SERVER['HTTP_REFERER'] ?? '');
$page = Strings::normaliseLink(DI::baseUrl()->get() . "/bookmarklet");
$page = Strings::normaliseLink(DI::baseUrl() . "/bookmarklet");
if (!strstr($referer, $page)) {
if (empty($_REQUEST["url"])) {

View file

@ -220,7 +220,7 @@ class Contact extends BaseModule
$tpl = Renderer::getMarkupTemplate('contacts-head.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
]);
$o = '';

View file

@ -236,7 +236,7 @@ class Profile extends BaseModule
$_SESSION['return_path'] = $this->args->getQueryString();
$this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_head.tpl'), [
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
]);
switch ($localRelationship->rel) {

View file

@ -166,7 +166,7 @@ class Redir extends \Friendica\BaseModule
}
if ($this->session->getRemoteUserId()) {
$host = substr($this->baseUrl->getUrlPath() . ($this->baseUrl->getUrlPath() ? '/' . $this->baseUrl->getUrlPath() : ''), strpos($this->baseUrl->getUrlPath(), '://') + 3);
$host = substr($this->baseUrl->getPath() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''), strpos($this->baseUrl->getPath(), '://') + 3);
$remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
// On a local instance we have to check if the local user has already authenticated

View file

@ -58,7 +58,7 @@ class Localtime extends BaseModule
$output .= '<p>' . DI::l10n()->t('Converted localtime: %s', self::$mod_localtime) . '</p>';
}
$output .= '<form action ="' . DI::baseUrl()->get() . '/localtime?time=' . $time . '" method="post" >';
$output .= '<form action ="' . DI::baseUrl() . '/localtime?time=' . $time . '" method="post" >';
$output .= '<p>' . DI::l10n()->t('Please select your timezone:') . '</p>';
$output .= Temporal::getTimezoneSelect(($_REQUEST['timezone'] ?? '') ?: Installer::DEFAULT_TZ);
$output .= '<input type="submit" name="submit" value="' . DI::l10n()->t('Submit') . '" /></form>';

View file

@ -61,7 +61,7 @@ class Fetch extends BaseModule
}
$host = $parts["scheme"] . "://" . $parts["host"];
if (Strings::normaliseLink($host) != Strings::normaliseLink(DI::baseUrl()->get())) {
if (Strings::normaliseLink($host) != Strings::normaliseLink(DI::baseUrl())) {
$location = $host . "/fetch/" . DI::args()->getArgv()[1] . "/" . urlencode($guid);
System::externalRedirect($location, 301);
}

View file

@ -71,7 +71,7 @@ class Friendica extends BaseModule
}
$tos = ($config->get('system', 'tosdisplay')) ?
DI::l10n()->t('Read about the <a href="%1$s/tos">Terms of Service</a> of this node.', DI::baseUrl()->get()) :
DI::l10n()->t('Read about the <a href="%1$s/tos">Terms of Service</a> of this node.', DI::baseUrl()) :
'';
$blockList = $config->get('system', 'blocklist');
@ -99,7 +99,7 @@ class Friendica extends BaseModule
return Renderer::replaceMacros($tpl, [
'about' => DI::l10n()->t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.',
'<strong>' . App::VERSION . '</strong>',
DI::baseUrl()->get(),
DI::baseUrl(),
'<strong>' . $config->get('system', 'build') . '/' . DB_UPDATE_VERSION . '</strong>',
'<strong>' . $keyValue->get('post_update_version') . '/' . PostUpdate::VERSION . '</strong>'),
'friendica' => DI::l10n()->t('Please visit <a href="https://friendi.ca">Friendi.ca</a> to learn more about the Friendica project.'),
@ -151,7 +151,7 @@ class Friendica extends BaseModule
if (!empty($administrator)) {
$admin = [
'name' => $administrator['username'],
'profile' => DI::baseUrl()->get() . '/profile/' . $administrator['nickname'],
'profile' => DI::baseUrl() . '/profile/' . $administrator['nickname'],
];
}
@ -172,7 +172,7 @@ class Friendica extends BaseModule
$data = [
'version' => App::VERSION,
'url' => DI::baseUrl()->get(),
'url' => DI::baseUrl(),
'addons' => $visible_addons,
'locked_features' => $locked_features,
'explicit_content' => intval($config->get('system', 'explicit_content', 0)),
@ -182,7 +182,7 @@ class Friendica extends BaseModule
'site_name' => $config->get('config', 'sitename'),
'platform' => strtolower(App::PLATFORM),
'info' => $config->get('config', 'info'),
'no_scrape_url' => DI::baseUrl()->get() . '/noscrape',
'no_scrape_url' => DI::baseUrl() . '/noscrape',
];
System::jsonExit($data);

View file

@ -66,15 +66,15 @@ class HCard extends BaseModule
$baseUrl = DI::baseUrl();
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHost() . ($baseUrl->getPath() ? '/' . $baseUrl->getPath() : ''));
$page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl->get() . '/dfrn_poll/' . $nickname . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $baseUrl->get() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $baseUrl->get() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl . '/dfrn_poll/' . $nickname . '" />' . "\r\n";
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $baseUrl . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
foreach (['request', 'confirm', 'notify', 'poll'] as $dfrn) {
$page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"" . $baseUrl->get() . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
$page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"" . $baseUrl . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
}
$block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());

View file

@ -102,7 +102,7 @@ class Help extends BaseModule
$idNum[$level] ++;
$href = DI::baseUrl()->get() . "/help/{$filename}#{$anchor}";
$href = DI::baseUrl() . "/help/{$filename}#{$anchor}";
$toc .= "<li><a href=\"{$href}\">" . strip_tags($line) . "</a></li>";
$id = implode("_", array_slice($idNum, 1, $level));
$line = "<a name=\"{$id}\"></a>" . $line;

View file

@ -69,7 +69,7 @@ class Home extends BaseModule
$customHome = $homeFilePath;
if (file_exists($cssFilePath)) {
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/home.css' . '" media="all" />';
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl() . '/home.css' . '" media="all" />';
}
}

View file

@ -149,14 +149,14 @@ class Invite extends BaseModule
if ($config->get('config', 'register_policy') === Register::CLOSED) {
$linkTxt = DI::l10n()->t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirLocation . '/servers');
} else {
$linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s or any other public Friendica website.', DI::baseUrl()->get())
$linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s or any other public Friendica website.', DI::baseUrl())
. "\r\n" . "\r\n" . DI::l10n()->t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.', $dirLocation . '/servers');
}
} else { // there is no global directory URL defined
if ($config->get('config', 'register_policy') === Register::CLOSED) {
return DI::l10n()->t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
} else {
$linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s.', DI::baseUrl()->get()
$linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s.', DI::baseUrl()
. "\r\n" . "\r\n" . DI::l10n()->t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
}
}
@ -172,7 +172,7 @@ class Invite extends BaseModule
DI::l10n()->t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
. $linkTxt
. "\r\n" . "\r\n" . (($inviteOnly) ? DI::l10n()->t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . DI::l10n()->t('Once you have registered, please connect with me via my profile page at:')
. "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->getLoggedInUserNickname()
. "\r\n" . "\r\n" . DI::baseUrl() . '/profile/' . $app->getLoggedInUserNickname()
. "\r\n" . "\r\n" . DI::l10n()->t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n",
],
'$submit' => DI::l10n()->t('Submit')

View file

@ -88,7 +88,7 @@ class Magic extends BaseModule
$contact = $this->dba->selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]);
// Redirect if the contact is already authenticated on this site.
if ($this->app->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl->get())) !== false) {
if ($this->app->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl)) !== false) {
$this->logger->info('Contact is already authenticated');
System::externalRedirect($dest);
}
@ -113,7 +113,7 @@ class Magic extends BaseModule
$header = HTTPSignature::createSig(
$header,
$user['prvkey'],
'acct:' . $user['nickname'] . '@' . $this->baseUrl->getHostname() . ($this->baseUrl->getUrlPath() ? '/' . $this->baseUrl->getUrlPath() : '')
'acct:' . $user['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : '')
);
// Try to get an authentication token from the other instance.

View file

@ -35,7 +35,7 @@ class Manifest extends BaseModule
$manifest = [
'name' => $config->get('config', 'sitename', 'Friendica'),
'start_url' => DI::baseUrl()->get(),
'start_url' => DI::baseUrl(),
'display' => 'standalone',
'description' => $config->get('config', 'info', DI::l10n()->t('A Decentralized Social Network')),
'short_name' => 'Friendica',
@ -74,12 +74,12 @@ class Manifest extends BaseModule
if($touch_icon){
$manifest['icons'] = [
[
'src' => DI::baseUrl()->get() . '/' . $touch_icon,
'src' => DI::baseUrl() . '/' . $touch_icon,
'sizes' => '192x192',
'type' => 'image/png',
],
[
'src' => DI::baseUrl()->get() . '/' . $touch_icon,
'src' => DI::baseUrl() . '/' . $touch_icon,
'sizes' => '512x512',
'type' => 'image/png',
],
@ -87,37 +87,37 @@ class Manifest extends BaseModule
} else {
$manifest['icons'] = [
[
'src' => DI::baseUrl()->get() . '/images/friendica.svg',
'src' => DI::baseUrl() . '/images/friendica.svg',
'sizes' => 'any',
'type' => 'image/svg+xml',
'purpose' => 'any',
],
[
'src' => DI::baseUrl()->get() . '/images/friendica-192.png',
'src' => DI::baseUrl() . '/images/friendica-192.png',
'sizes' => '192x192',
'type' => 'image/png',
'purpose' => 'any',
],
[
'src' => DI::baseUrl()->get() . '/images/friendica-512.png',
'src' => DI::baseUrl() . '/images/friendica-512.png',
'sizes' => '512x512',
'type' => 'image/png',
'purpose' => 'any',
],
[
'src' => DI::baseUrl()->get() . '/images/friendica-maskable.svg',
'src' => DI::baseUrl() . '/images/friendica-maskable.svg',
'sizes' => 'any',
'type' => 'image/svg+xml',
'purpose' => 'maskable',
],
[
'src' => DI::baseUrl()->get() . '/images/friendica-maskable-192.png',
'src' => DI::baseUrl() . '/images/friendica-maskable-192.png',
'sizes' => '192x192',
'type' => 'image/png',
'purpose' => 'maskable',
],
[
'src' => DI::baseUrl()->get() . '/images/friendica-maskable-512.png',
'src' => DI::baseUrl() . '/images/friendica-maskable-512.png',
'sizes' => '512x512',
'type' => 'image/png',
'purpose' => 'maskable',

View file

@ -124,7 +124,7 @@ class Contact extends BaseModeration
'$form_security_token' => self::getFormSecurityToken('moderation_contactblock'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$contacts' => $contacts,
'$total_contacts' => $this->tt('%s total blocked contact', '%s total blocked contacts', $total),

View file

@ -138,7 +138,7 @@ class Add extends BaseModeration
'$newreason' => ['reason', $this->t('Block reason'), $request['reason'] ?? '', $this->t('The reason why you blocked this server domain pattern. This reason will be shown publicly in the server information page.'), $this->t('Required'), '', ''],
'$pattern' => $pattern,
'$gservers' => $gservers,
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$form_security_token' => self::getFormSecurityToken('moderation_blocklist_add')
]);
}

View file

@ -130,7 +130,7 @@ class Import extends \Friendica\Module\BaseModeration
'$mode_append' => ['mode', $this->t('Append'), 'append', $this->t('Imports patterns from the file that weren\'t already existing in the current blocklist.'), 'checked="checked"'],
'$mode_replace' => ['mode', $this->t('Replace'), 'replace', $this->t('Replaces the current blocklist by the imported patterns.')],
'$blocklist' => $this->blocklist,
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$form_security_token' => self::getFormSecurityToken('moderation_blocklist_import')
]);
}

View file

@ -115,7 +115,7 @@ class Index extends BaseModeration
'$listfile' => ['listfile', $this->t('Server domain pattern blocklist CSV file'), '', '', $this->t('Required'), '', 'file'],
'$newdomain' => ['pattern', $this->t('Server Domain Pattern'), '', $this->t('The domain pattern of the new server to add to the blocklist. Do not include the protocol.'), $this->t('Required'), '', ''],
'$entries' => $blocklistform,
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$form_security_token' => self::getFormSecurityToken('moderation_blocklist'),
'$form_security_token_import' => self::getFormSecurityToken('moderation_blocklist_import'),

View file

@ -32,7 +32,7 @@ class Active extends BaseUsers
{
$this->checkModerationAccess();
self::checkFormSecurityTokenRedirectOnError($this->baseUrl->get(true), 'moderation_users_active');
self::checkFormSecurityTokenRedirectOnError($this->baseUrl, 'moderation_users_active');
$users = $request['user'] ?? [];
@ -150,7 +150,7 @@ class Active extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('moderation_users_active'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$users' => $users,

View file

@ -149,7 +149,7 @@ class Blocked extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('moderation_users_blocked'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$users' => $users,

View file

@ -65,7 +65,7 @@ class Create extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('admin_users_create'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$newusername' => ['new_user_name', $this->t('Name'), '', $this->t('Name of the new user.')],

View file

@ -85,7 +85,7 @@ class Deleted extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('moderation_users_deleted'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$users' => $users,

View file

@ -83,7 +83,7 @@ class Index extends BaseUsers
switch ($action) {
case 'delete':
if ($this->session->getLocalUserId() != $uid) {
self::checkFormSecurityTokenRedirectOnError($this->baseUrl->get(true), 'moderation_users', 't');
self::checkFormSecurityTokenRedirectOnError($this->baseUrl, 'moderation_users', 't');
// delete user
User::remove($uid);
@ -168,7 +168,7 @@ class Index extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('moderation_users'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$users' => $users,

View file

@ -105,7 +105,7 @@ class Pending extends BaseUsers
'$form_security_token' => self::getFormSecurityToken('admin_users_pending'),
// values //
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$query_string' => $this->args->getQueryString(),
'$pending' => $pending,

View file

@ -52,7 +52,7 @@ class NodeInfo210 extends BaseModule
$nodeinfo = [
'version' => '1.0',
'server' => [
'baseUrl' => $this->baseUrl->get(),
'baseUrl' => $this->baseUrl,
'name' => $this->config->get('config', 'sitename'),
'software' => 'friendica',
'version' => App::VERSION . '-' . DB_UPDATE_VERSION,

View file

@ -244,7 +244,7 @@ class Ping extends BaseModule
$registration['url'],
$this->l10n->t('{0} requested registration'),
new \DateTime($registration['created'], new \DateTimeZone('UTC')),
new Uri($this->baseUrl->get(true) . '/moderation/users/pending')
new Uri($this->baseUrl . '/moderation/users/pending')
);
}
} else {
@ -253,7 +253,7 @@ class Ping extends BaseModule
$registrations[0]['url'],
$this->l10n->t('{0} and %d others requested registration', count($registrations) - 1),
new \DateTime($registrations[0]['created'], new \DateTimeZone('UTC')),
new Uri($this->baseUrl->get(true) . '/moderation/users/pending')
new Uri($this->baseUrl . '/moderation/users/pending')
);
}

View file

@ -39,8 +39,8 @@ class OpenSearch extends BaseModule
*/
protected function rawContent(array $request = [])
{
$hostname = DI::baseUrl()->getHostname();
$baseUrl = DI::baseUrl()->get();
$hostname = DI::baseUrl()->getHost();
$baseUrl = DI::baseUrl();
/** @var DOMDocument $xml */
XML::fromArray([

View file

@ -352,7 +352,7 @@ class Profile extends BaseProfile
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/" title="' . $this->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/comments" title="' . $this->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/activity" title="' . $this->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHostname() . ($this->baseUrl->getUrlPath() ? '/' . $this->baseUrl->getUrlPath() : ''));
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''));
$htmlhead .= '<link rel="lrdd" type="application/xrd+xml" href="' . $this->baseUrl . '/xrd/?uri=' . $uri . '" />' . "\n";
header('Link: <' . $this->baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);

View file

@ -78,7 +78,7 @@ class Schedule extends BaseProfile
$tpl = Renderer::getMarkupTemplate('profile/schedule.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$title' => DI::l10n()->t('Scheduled Posts'),
'$nickname' => $this->parameters['nickname'] ?? '',
'$scheduled_at' => DI::l10n()->t('Scheduled'),

View file

@ -141,7 +141,7 @@ class UnkMail extends \Friendica\BaseModule
$tpl = Renderer::getMarkupTemplate('profile/unkmail-header.tpl');
$this->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$nickname' => $user['nickname'],
'$linkurl' => $this->l10n->t('Please enter a link URL:')
]);

View file

@ -48,7 +48,7 @@ class ReallySimpleDiscovery extends BaseModule
'@attributes' => [
'name' => 'Twitter',
'preferred' => 'true',
'apiLink' => DI::baseUrl()->get(),
'apiLink' => DI::baseUrl(),
'blogID' => '',
],
'settings' => [

View file

@ -161,7 +161,7 @@ class Register extends BaseModule
'$ask_password' => $ask_password,
'$password1' => ['password1', DI::l10n()->t('New Password:'), '', DI::l10n()->t('Leave empty for an auto generated password.')],
'$password2' => ['confirm', DI::l10n()->t('Confirm:'), '', ''],
'$nickdesc' => DI::l10n()->t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be "<strong>nickname@%s</strong>".', DI::baseUrl()->getHostname()),
'$nickdesc' => DI::l10n()->t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be "<strong>nickname@%s</strong>".', DI::baseUrl()->getHost()),
'$nicklabel' => DI::l10n()->t('Choose a nickname: '),
'$photo' => $photo,
'$publish' => $profile_publish,
@ -169,7 +169,7 @@ class Register extends BaseModule
'$username' => $username,
'$email' => $email,
'$nickname' => $nickname,
'$sitename' => DI::baseUrl()->getHostname(),
'$sitename' => DI::baseUrl()->getHost(),
'$importh' => DI::l10n()->t('Import'),
'$importt' => DI::l10n()->t('Import your profile to this friendica instance'),
'$showtoslink' => DI::config()->get('system', 'tosdisplay'),
@ -298,7 +298,7 @@ class Register extends BaseModule
$user = $result['user'];
$base_url = DI::baseUrl()->get();
$base_url = DI::baseUrl();
if ($netpublish && intval(DI::config()->get('config', 'register_policy')) !== self::APPROVE) {
$url = $base_url . '/profile/' . $user['nickname'];
@ -404,11 +404,11 @@ class Register extends BaseModule
'type' => Model\Notification\Type::SYSTEM,
'event' => $event,
'uid' => $admin['uid'],
'link' => DI::baseUrl()->get(true) . '/moderation/users/',
'link' => DI::baseUrl() . '/moderation/users/',
'source_name' => $user['username'],
'source_mail' => $user['email'],
'source_nick' => $user['nickname'],
'source_link' => DI::baseUrl()->get(true) . '/moderation/users/',
'source_link' => DI::baseUrl() . '/moderation/users/',
'source_photo' => User::getAvatarUrl($user, Proxy::SIZE_THUMB),
'show_in_notification_page' => false
]);

View file

@ -132,7 +132,7 @@ class Login extends BaseModule
DI::page()['htmlhead'] .= Renderer::replaceMacros(
Renderer::getMarkupTemplate('login_head.tpl'),
[
'$baseurl' => DI::baseUrl()->get(true)
'$baseurl' => DI::baseUrl()
]
);
@ -154,7 +154,7 @@ class Login extends BaseModule
$o = Renderer::replaceMacros(
$tpl,
[
'$dest_url' => DI::baseUrl()->get(true) . '/login',
'$dest_url' => DI::baseUrl() . '/login',
'$logout' => DI::l10n()->t('Logout'),
'$login' => DI::l10n()->t('Login'),

View file

@ -43,7 +43,7 @@ class OpenID extends BaseModule
if (!empty($_GET['openid_mode']) && !empty($session->get('openid'))) {
$openid = new LightOpenID(DI::baseUrl()->getHostname());
$openid = new LightOpenID(DI::baseUrl()->getHost());
$l10n = DI::l10n();
@ -82,7 +82,7 @@ class OpenID extends BaseModule
$session->set('openid_identity', $authId);
// Detect the server URL
$open_id_obj = new LightOpenID(DI::baseUrl()->getHostname());
$open_id_obj = new LightOpenID(DI::baseUrl()->getHost());
$open_id_obj->identity = $authId;
$session->set('openid_server', $open_id_obj->discover($open_id_obj->identity));

View file

@ -93,7 +93,7 @@ class PasswordTooLong extends \Friendica\BaseModule
'submit' => $this->l10n->t('Update Password'),
],
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$form_security_token' => self::getFormSecurityToken('security/password_too_long'),
'$return_url' => $request['return_url'] ?? '',

View file

@ -555,10 +555,10 @@ class Account extends BaseSettings
$tpl = Renderer::getMarkupTemplate('settings/account.tpl');
$o = Renderer::replaceMacros($tpl, [
'$ptitle' => DI::l10n()->t('Account Settings'),
'$desc' => DI::l10n()->t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHostname() . DI::baseUrl()->getUrlPath(), DI::baseUrl() . '/profile/' . $nickname),
'$desc' => DI::l10n()->t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHost() . DI::baseUrl()->getPath(), DI::baseUrl() . '/profile/' . $nickname),
'$submit' => DI::l10n()->t('Save Settings'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$uid' => DI::userSession()->getLocalUserId(),
'$form_security_token' => self::getFormSecurityToken('settings'),
'$open' => $this->parameters['open'] ?? 'password',

View file

@ -252,7 +252,7 @@ class Display extends BaseSettings
'$calendar_title' => $this->t('Calendar'),
'$form_security_token' => self::getFormSecurityToken('settings_display'),
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$uid' => $uid,
'$theme' => ['theme', $this->t('Display Theme:'), $theme_selected, '', $themes, true],

View file

@ -68,7 +68,7 @@ class OAuth extends BaseSettings
$tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
return Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseSettings::getFormSecurityToken('settings_oauth'),
'$baseurl' => $this->baseUrl->get(true),
'$baseurl' => $this->baseUrl,
'$title' => $this->t('Connected Apps'),
'$name' => $this->t('Name'),
'$website' => $this->t('Home Page'),

View file

@ -208,7 +208,7 @@ class Index extends BaseSettings
];
DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/profile/index_head.tpl'), [
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
]);
$personal_account = ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY);
@ -241,7 +241,7 @@ class Index extends BaseSettings
'$lbl_profile_photo' => DI::l10n()->t('Upload Profile Photo'),
'$baseurl' => DI::baseUrl()->get(true),
'$baseurl' => DI::baseUrl(),
'$nickname' => $profile['nickname'],
'$name' => ['name', DI::l10n()->t('Display name:'), $profile['name']],
'$about' => ['about', DI::l10n()->t('Description:'), $profile['about']],

View file

@ -46,14 +46,14 @@ class HostMeta extends BaseModule
$config->set('system', 'site_pubkey', $res['pubkey']);
}
$domain = DI::baseUrl()->get();
$domain = DI::baseUrl();
XML::fromArray([
'XRD' => [
'@attributes' => [
'xmlns' => 'http://docs.oasis-open.org/ns/xri/xrd-1.0',
],
'hm:Host' => DI::baseUrl()->getHostname(),
'hm:Host' => DI::baseUrl()->getHost(),
'1:link' => [
'@attributes' => [
'rel' => 'lrdd',

View file

@ -46,9 +46,9 @@ class NodeInfo extends BaseModule
$nodeinfo = [
'links' => [
['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
'href' => DI::baseUrl()->get() . '/nodeinfo/1.0'],
'href' => DI::baseUrl() . '/nodeinfo/1.0'],
['rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0',
'href' => DI::baseUrl()->get() . '/nodeinfo/2.0'],
'href' => DI::baseUrl() . '/nodeinfo/2.0'],
]
];

View file

@ -64,17 +64,17 @@ class XSocialRelay extends BaseModule
'tags' => $tagList,
'protocols' => [
'activitypub' => [
'actor' => DI::baseUrl()->get() . '/friendica',
'receive' => DI::baseUrl()->get() . '/inbox'
'actor' => DI::baseUrl() . '/friendica',
'receive' => DI::baseUrl() . '/inbox'
],
'dfrn' => [
'receive' => DI::baseUrl()->get() . '/dfrn_notify'
'receive' => DI::baseUrl() . '/dfrn_notify'
]
]
];
if (DI::config()->get("system", "diaspora_enabled")) {
$relay['protocols']['diaspora'] = ['receive' => DI::baseUrl()->get() . '/receive/public'];
$relay['protocols']['diaspora'] = ['receive' => DI::baseUrl() . '/receive/public'];
}
System::jsonExit($relay);

View file

@ -105,7 +105,7 @@ class Xrd extends BaseModule
private function printSystemJSON(array $owner)
{
$baseURL = $this->baseUrl->get();
$baseURL = $this->baseUrl;
$json = [
'subject' => 'acct:' . $owner['addr'],
'aliases' => [$owner['url']],
@ -151,7 +151,7 @@ class Xrd extends BaseModule
private function printJSON(string $alias, array $owner, array $avatar)
{
$baseURL = $this->baseUrl->get();
$baseURL = $this->baseUrl;
$json = [
'subject' => 'acct:' . $owner['addr'],
@ -228,7 +228,7 @@ class Xrd extends BaseModule
private function printXML(string $alias, array $owner, array $avatar)
{
$baseURL = $this->baseUrl->get();
$baseURL = $this->baseUrl;
$xmlString = XML::fromArray([
'XRD' => [