]> git.mxchange.org Git - friendica.git/commitdiff
Adapt BaseURL calls to new UriInterface
authorPhilipp <admin@philipp.info>
Sat, 18 Feb 2023 19:57:30 +0000 (20:57 +0100)
committerPhilipp <admin@philipp.info>
Sat, 18 Feb 2023 20:12:21 +0000 (21:12 +0100)
101 files changed:
mod/message.php
src/App/Page.php
src/Console/AutomaticInstallation.php
src/Console/MoveToAvatarCache.php
src/Console/Relocate.php
src/Content/Conversation.php
src/Content/Item.php
src/Content/Nav.php
src/Content/Text/BBCode.php
src/Core/Cache/Factory/Cache.php
src/Core/Renderer.php
src/Core/Session/Type/Native.php
src/Core/System.php
src/Factory/Api/Friendica/Photo.php
src/Model/Contact.php
src/Model/Item.php
src/Model/Nodeinfo.php
src/Model/Photo.php
src/Model/Profile.php
src/Model/User.php
src/Model/User/Cookie.php
src/Module/ActivityPub/Objects.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Logs/View.php
src/Module/Admin/Site.php
src/Module/Admin/Storage.php
src/Module/Admin/Summary.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Api/GNUSocial/GNUSocial/Config.php
src/Module/Api/Twitter/ContactEndpoint.php
src/Module/Blocklist/Domain/Download.php
src/Module/Bookmarklet.php
src/Module/Contact.php
src/Module/Contact/Profile.php
src/Module/Contact/Redir.php
src/Module/Debug/Localtime.php
src/Module/Diaspora/Fetch.php
src/Module/Friendica.php
src/Module/HCard.php
src/Module/Help.php
src/Module/Home.php
src/Module/Invite.php
src/Module/Magic.php
src/Module/Manifest.php
src/Module/Moderation/Blocklist/Contact.php
src/Module/Moderation/Blocklist/Server/Add.php
src/Module/Moderation/Blocklist/Server/Import.php
src/Module/Moderation/Blocklist/Server/Index.php
src/Module/Moderation/Users/Active.php
src/Module/Moderation/Users/Blocked.php
src/Module/Moderation/Users/Create.php
src/Module/Moderation/Users/Deleted.php
src/Module/Moderation/Users/Index.php
src/Module/Moderation/Users/Pending.php
src/Module/NodeInfo210.php
src/Module/Notifications/Ping.php
src/Module/OpenSearch.php
src/Module/Profile/Profile.php
src/Module/Profile/Schedule.php
src/Module/Profile/UnkMail.php
src/Module/ReallySimpleDiscovery.php
src/Module/Register.php
src/Module/Security/Login.php
src/Module/Security/OpenID.php
src/Module/Security/PasswordTooLong.php
src/Module/Settings/Account.php
src/Module/Settings/Display.php
src/Module/Settings/OAuth.php
src/Module/Settings/Profile/Index.php
src/Module/WellKnown/HostMeta.php
src/Module/WellKnown/NodeInfo.php
src/Module/WellKnown/XSocialRelay.php
src/Module/Xrd.php
src/Navigation/Notifications/Factory/FormattedNavNotification.php
src/Navigation/Notifications/Factory/FormattedNotify.php
src/Navigation/Notifications/Factory/Introduction.php
src/Navigation/Notifications/Repository/Notify.php
src/Network/HTTPClient/Factory/HttpClient.php
src/Network/Probe.php
src/Object/Api/Mastodon/Account.php
src/Object/Api/Mastodon/Instance.php
src/Object/Api/Mastodon/Mention.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/Delivery.php
src/Protocol/Feed.php
src/Protocol/OStatus.php
src/Security/Authentication.php
src/Security/ExAuth.php
src/Util/EMailer/MailBuilder.php
src/Util/Emailer.php
src/Worker/NodeInfo.php
src/Worker/Notifier.php
src/Worker/PushSubscription.php
view/theme/frio/php/default.php
view/theme/smoothly/theme.php

index 726db0a754a6002d9b110726e80120895e958899..c5d923de0bb90d0ef42c45302470ecf6dc7b43fe 100644 (file)
@@ -58,7 +58,7 @@ function message_init(App $a)
 
        $head_tpl = Renderer::getMarkupTemplate('message-head.tpl');
        DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [
-               '$baseurl' => DI::baseUrl()->get(true),
+               '$baseurl' => DI::baseUrl(),
                '$base'    => $base
        ]);
 }
@@ -178,7 +178,7 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('msg-header.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => DI::baseUrl()->get(true),
+                       '$baseurl' => DI::baseUrl(),
                        '$nickname' => $a->getLoggedInUserNickname(),
                        '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
@@ -284,7 +284,7 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('msg-header.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => DI::baseUrl()->get(true),
+                       '$baseurl' => DI::baseUrl(),
                        '$nickname' => $a->getLoggedInUserNickname(),
                        '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
index a91d400ee88057d99b220f7e5a7f257b7e0c2b95..e226252124fed000336299b23c859ccbdb48217f 100644 (file)
@@ -523,7 +523,7 @@ class Page implements ArrayAccess
                header("X-Friendica-Version: " . App::VERSION);
                header("Content-type: text/html; charset=utf-8");
 
-               if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) {
+               if ($config->get('system', 'hsts') && ($baseURL->getScheme() === 'https')) {
                        header("Strict-Transport-Security: max-age=31536000");
                }
 
index 83c6ac4c3865e77b6e6e5ffe17bbcd8ce12975fa..1ce516e25f66484d5a3abd4630855243755a02d3 100644 (file)
@@ -199,8 +199,7 @@ HELP;
                                $this->out('The Friendica URL has to be set during CLI installation.');
                                return 1;
                        } else {
-                               $baseUrl = new BaseURL($this->config, []);
-                               $baseUrl->saveByURL($url);
+                               $configCache->set('system', 'url', $url);
                        }
 
                        $installer->createConfig($configCache);
index 13a8debcb478a5ff1455e3f39e251aefa436ac8c..055b0c2c0d52c95ce31506d7768d3857e1ec63ff 100644 (file)
@@ -94,7 +94,7 @@ HELP;
 
                $fields = ['id', 'avatar', 'photo', 'thumb', 'micro', 'uri-id', 'url', 'avatar', 'network'];
                $condition = ["NOT `self` AND `avatar` != ? AND `photo` LIKE ? AND `uid` = ? AND `uri-id` != ? AND NOT `uri-id` IS NULL AND NOT `network` IN (?, ?)",
-                       '', $this->baseUrl->get() . '/photo/%', 0, 0, Protocol::MAIL, Protocol::FEED];
+                       '', $this->baseUrl . '/photo/%', 0, 0, Protocol::MAIL, Protocol::FEED];
 
                $count    = 0;
                $total    = $this->dba->count('contact', $condition);
index c63434cbb7e6e22b2176342937ecf6be30238f81..a6fdd8bfbd1304a0ecff34e1656236fd04b6334e 100644 (file)
@@ -92,9 +92,9 @@ HELP;
                        throw new \InvalidArgumentException('Can not parse new base URL. Must have at least <scheme>://<domain>');
                }
 
-               $this->out(sprintf('Relocation started from %s to %s. Could take a while to complete.', $this->baseUrl->get(true), $this->getArgument(0)));
+               $this->out(sprintf('Relocation started from %s to %s. Could take a while to complete.', $this->baseUrl, $this->getArgument(0)));
 
-               $old_url = $this->baseUrl->get(true);
+               $old_url = $this->baseUrl;
 
                // Generate host names for relocation the addresses in the format user@address.tld
                $new_host = str_replace('http://', '@', Strings::normaliseLink($new_url));
@@ -179,7 +179,6 @@ HELP;
                        // update config
                        $this->out('Updating config values');
                        $this->config->set('system', 'url', $new_url);
-                       $this->baseUrl->saveByURL($new_url);
 
                        $this->database->commit();
                } catch (\Throwable $e) {
index de4b6903886c997b2083b423154a785b6fd9e920..4dd52ebff5851ff4296ae09c4c8153955d4d4323 100644 (file)
@@ -314,7 +314,7 @@ class Conversation
                $tpl = Renderer::getMarkupTemplate('jot-header.tpl');
                $this->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
                        '$newpost'   => 'true',
-                       '$baseurl'   => $this->baseURL->get(true),
+                       '$baseurl'   => $this->baseURL,
                        '$geotag'    => $geotag,
                        '$nickname'  => $x['nickname'],
                        '$ispublic'  => $this->l10n->t('Visible to <strong>everybody</strong>'),
@@ -385,7 +385,7 @@ class Conversation
                        '$posttype'     => $notes_cid ? ItemModel::PT_PERSONAL_NOTE : ItemModel::PT_ARTICLE,
                        '$content'      => $x['content'] ?? '',
                        '$post_id'      => $x['post_id'] ?? '',
-                       '$baseurl'      => $this->baseURL->get(true),
+                       '$baseurl'      => $this->baseURL,
                        '$defloc'       => $x['default_location'],
                        '$visitor'      => $x['visitor'],
                        '$pvisit'       => $notes_cid ? 'none' : $x['visitor'],
@@ -784,7 +784,7 @@ class Conversation
                }
 
                $o = Renderer::replaceMacros($page_template, [
-                       '$baseurl'     => $this->baseURL->get($ssl_state),
+                       '$baseurl'     => $this->baseURL,
                        '$return_path' => $this->args->getQueryString(),
                        '$live_update' => $live_update_div,
                        '$remove'      => $this->l10n->t('remove'),
index 0d47cde92f2190ee121da30d1e3fec037fe70ea4..2e86fb82d622711d5f6d70f1a3d4f070938f81b6 100644 (file)
@@ -903,7 +903,7 @@ class Item
                        if ($post['attach']) {
                                $post['attach'] .= ',';
                        }
-                       $post['attach'] .= Post\Media::getAttachElement($this->baseURL->get() . '/attach/' . $attachment['id'],
+                       $post['attach'] .= Post\Media::getAttachElement($this->baseURL . '/attach/' . $attachment['id'],
                                $attachment['filesize'], $attachment['filetype'], $attachment['filename'] ?? '');
 
                        $fields = ['allow_cid' => $post['allow_cid'], 'allow_gid' => $post['allow_gid'],
index 63eeede89fffbb58988b42670833068599bf247e..55d9b3d51b54ec95bc26f49ec63d0344bb69d91f 100644 (file)
@@ -194,7 +194,7 @@ class Nav
 
                $myident = !empty($this->session->getLocalUserNickname()) ? $this->session->getLocalUserNickname() . '@' : '';
 
-               $sitelocation = $myident . substr($this->baseUrl->get($ssl_state), strpos($this->baseUrl->get($ssl_state), '//') + 2);
+               $sitelocation = $myident . substr($this->baseUrl, strpos($this->baseUrl, '//') + 2);
 
                $nav = [
                        'admin'         => null,
index 83056b2692eb07d37d338b6725b34876818d41d4..6730309e60ee96b1a14be4d098baf75aa2ffe19a 100644 (file)
@@ -1274,7 +1274,7 @@ class BBCode
        private static function cleanPictureLinksCallback(array $match): string
        {
                // When the picture link is the own photo path then we can avoid fetching the link
-               $own_photo_url = preg_quote(Strings::normaliseLink(DI::baseUrl()->get()) . '/photos/');
+               $own_photo_url = preg_quote(Strings::normaliseLink(DI::baseUrl()) . '/photos/');
                if (preg_match('|' . $own_photo_url . '.*?/image/|', Strings::normaliseLink($match[1]))) {
                        if (!empty($match[3])) {
                                $text = '[img=' . str_replace('-1.', '-0.', $match[2]) . ']' . $match[3] . '[/img]';
@@ -2099,8 +2099,8 @@ class BBCode
 
                // Default iframe allowed domains/path
                $allowedIframeDomains = [
-                       DI::baseUrl()->getHostname()
-                       . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : '')
+                       DI::baseUrl()->getHost()
+                       . (DI::baseUrl()->getPath() ? '/' . DI::baseUrl()->getPath() : '')
                        . '/oembed/', # The path part has to change with the source in Content\Oembed::iframe
                        'www.youtube.com/embed/',
                        'player.vimeo.com/video/',
index 715a09f4ac423f8474e91a63705573bb03947ce4..107c6ab216da82d8f11a963404724d852c741d5f 100644 (file)
@@ -73,7 +73,7 @@ class Cache
 
        public function __construct(BaseURL $baseURL, IManageConfigValues $config, Database $dba, Profiler $profiler, LoggerInterface $logger)
        {
-               $this->hostname = $baseURL->getHostname();
+               $this->hostname = $baseURL->getHost();
                $this->config   = $config;
                $this->dba      = $dba;
                $this->profiler = $profiler;
index 0204d54b5d505d340de128179e46e744a1534cea..7f11f3f8e2a5ccd945692975675995711a04552e 100644 (file)
@@ -76,7 +76,7 @@ class Renderer
                DI::profiler()->startRecording('rendering');
 
                // pass $baseurl to all templates if it isn't set
-               $vars = array_merge(['$baseurl' => DI::baseUrl()->get(), '$APP' => DI::app()], $vars);
+               $vars = array_merge(['$baseurl' => DI::baseUrl(), '$APP' => DI::app()], $vars);
 
                $t = self::getTemplateEngine();
 
index 943050e05d65289e4183919a4a057d7d67f3e7f5..2804a7346ff8f0e8f03dd31367ddcaa413d21f34 100644 (file)
@@ -37,7 +37,7 @@ class Native extends AbstractSession implements IHandleSessions
                ini_set('session.use_only_cookies', 1);
                ini_set('session.cookie_httponly', (int)Cookie::HTTPONLY);
 
-               if ($baseURL->getSSLPolicy() == App\BaseURL::SSL_POLICY_FULL) {
+               if ($baseURL->getScheme() === 'https') {
                        ini_set('session.cookie_secure', 1);
                }
 
index bbcb3ab09e676040dde145642eeae7ee255f65b5..107303d6a6c6b3a6bf8f9b41562663e590f3073d 100644 (file)
@@ -401,7 +401,7 @@ class System
                if (is_bool($prefix) && !$prefix) {
                        $prefix = '';
                } elseif (empty($prefix)) {
-                       $prefix = hash('crc32', DI::baseUrl()->getHostname());
+                       $prefix = hash('crc32', DI::baseUrl()->getHost());
                }
 
                while (strlen($prefix) < ($size - 13)) {
@@ -604,7 +604,7 @@ class System
                        $temppath = BasePath::getRealPath($temppath);
 
                        // To avoid any interferences with other systems we create our own directory
-                       $new_temppath = $temppath . "/" . DI::baseUrl()->getHostname();
+                       $new_temppath = $temppath . "/" . DI::baseUrl()->getHost();
                        if (!is_dir($new_temppath)) {
                                /// @TODO There is a mkdir()+chmod() upwards, maybe generalize this (+ configurable) into a function/method?
                                mkdir($new_temppath);
index ced0774e8c51d162e642cfcda5095abce037f551..63592614e0ac818d4cf20cfc9c1c669a953f66b3 100644 (file)
@@ -90,7 +90,7 @@ class Photo extends BaseFactory
                }
 
                foreach ($photos as $id => $photo) {
-                       $link = $this->baseUrl->get() . '/photo/' . $data['resource-id'] . '-' . $photo['scale'] . Images::getExtensionByMimeType($data['type']);
+                       $link = $this->baseUrl . '/photo/' . $data['resource-id'] . '-' . $photo['scale'] . Images::getExtensionByMimeType($data['type']);
                        if ($type == 'xml') {
                                $data['links'][$photo['scale'] . ':link']['@attributes'] = [
                                        'type'  => $data['type'],
index 0ff29f88866e03d3b5c5e24b35dba73ce845b184..571253f42588bde9c58fe97ad1e8d29c21d53277 100644 (file)
@@ -570,7 +570,7 @@ class Contact
        {
                if (!parse_url($url, PHP_URL_SCHEME)) {
                        $addr_parts = explode('@', $url);
-                       return (count($addr_parts) == 2) && ($addr_parts[1] == DI::baseUrl()->getHostname());
+                       return (count($addr_parts) == 2) && ($addr_parts[1] == DI::baseUrl()->getHost());
                }
 
                return Strings::compareLink(self::getBasepath($url, true), DI::baseUrl());
index b2daed13e4b2f80516edb8743fa736bc17bec514..89390317fe42694f9888421ae65032536a614de6 100644 (file)
@@ -408,7 +408,7 @@ class Item
                if ($notify) {
                        // We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
                        // We add the hash of our own host because our host is the original creator of the post.
-                       $prefix_host = DI::baseUrl()->getHostname();
+                       $prefix_host = DI::baseUrl()->getHost();
                } else {
                        $prefix_host = '';
 
@@ -2048,7 +2048,7 @@ class Item
                        $guid = System::createUUID();
                }
 
-               return DI::baseUrl()->get() . '/objects/' . $guid;
+               return DI::baseUrl() . '/objects/' . $guid;
        }
 
        /**
@@ -2288,7 +2288,7 @@ class Item
                }
 
                // Prevent to forward already forwarded posts
-               if ($datarray['app'] == DI::baseUrl()->getHostname()) {
+               if ($datarray['app'] == DI::baseUrl()->getHost()) {
                        Logger::info('Already forwarded (second test)');
                        return false;
                }
index 07f56dd7bb83970464a0f9f738f242e57722cd1a..51692f01635c3b2dd45e6092b166fc456d91bfe3 100644 (file)
@@ -171,7 +171,7 @@ class Nodeinfo
                return [
                        'name'    => $administrator['username'] ?? null,
                        'contact' => $administrator['email']    ?? null,
-                       'account' => $administrator['nickname'] ?? '' ? DI::baseUrl()->get() . '/profile/' . $administrator['nickname'] : null,
+                       'account' => $administrator['nickname'] ?? '' ? DI::baseUrl() . '/profile/' . $administrator['nickname'] : null,
                ];
        }
 }
index bcb5b20f951aa63d7f6f6fec2c2a349400aacfae..96c82b0c17d84c0cc095e8872b919cafee805be3 100644 (file)
@@ -918,7 +918,7 @@ class Photo
         */
        public static function getResourceData(string $name): array
        {
-               $base = DI::baseUrl()->get();
+               $base = DI::baseUrl();
 
                $guid = str_replace([Strings::normaliseLink($base), '/photo/'], '', Strings::normaliseLink($name));
 
@@ -982,7 +982,7 @@ class Photo
         */
        public static function isLocalPage(string $name): bool
        {
-               $base = DI::baseUrl()->get();
+               $base = DI::baseUrl();
 
                $guid = str_replace(Strings::normaliseLink($base), '', Strings::normaliseLink($name));
                $guid = preg_replace("=/photos/.*/image/(.*)=ism", '$1', $guid);
index 8ff942ba46226e6cfafaae61997a05f730b001ea..b30cca8a6e8568fa74cf4dabfbf1a4288ea08bd3 100644 (file)
@@ -334,7 +334,7 @@ class Profile
                if (!$local_user_is_self) {
                        if (!$visitor_is_authenticated) {
                                // Remote follow is only available for local profiles
-                               if (!empty($profile['nickname']) && strpos($profile_url, DI::baseUrl()->get()) === 0) {
+                               if (!empty($profile['nickname']) && strpos($profile_url, DI::baseUrl()) === 0) {
                                        $follow_link = 'profile/' . $profile['nickname'] . '/remote_follow';
                                }
                        } else {
@@ -756,13 +756,13 @@ class Profile
                $query = rtrim(str_replace($addr_request, '', DI::args()->getQueryString()), '?&');
 
                // The other instance needs to know where to redirect.
-               $dest = urlencode(DI::baseUrl()->get() . '/' . $query);
+               $dest = urlencode(DI::baseUrl() . '/' . $query);
 
                // We need to extract the basebath from the profile url
                // to redirect the visitors '/magic' module.
                $basepath = Contact::getBasepath($contact['url']);
 
-               if ($basepath != DI::baseUrl()->get() && !strstr($dest, '/magic')) {
+               if ($basepath != DI::baseUrl() && !strstr($dest, '/magic')) {
                        $magic_path = $basepath . '/magic' . '?owa=1&dest=' . $dest . '&' . $addr_request;
 
                        // We have to check if the remote server does understand /magic without invoking something
@@ -870,7 +870,7 @@ class Profile
 
                $a->setContactId($arr['visitor']['id']);
 
-               DI::sysmsg()->addInfo(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
+               DI::sysmsg()->addInfo(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHost(), $visitor['name']));
 
                Logger::info('OpenWebAuth: auth success from ' . $visitor['addr']);
        }
index 75b913250c304099afa3eb9832d2b058351ebe2b..b0ece93464ca70fc5518323056006cfbdf16a372 100644 (file)
@@ -166,7 +166,7 @@ class User
                $system['region'] = '';
                $system['postal-code'] = '';
                $system['country-name'] = '';
-               $system['homepage'] = DI::baseUrl()->get();
+               $system['homepage'] = DI::baseUrl();
                $system['dob'] = '0000-00-00';
 
                // Ensure that the user contains data
@@ -219,7 +219,7 @@ class User
                        'self'         => true,
                        'network'      => Protocol::ACTIVITYPUB,
                        'name'         => 'System Account',
-                       'addr'         => $system_actor_name . '@' . DI::baseUrl()->getHostname(),
+                       'addr'         => $system_actor_name . '@' . DI::baseUrl()->getHost(),
                        'nick'         => $system_actor_name,
                        'url'          => DI::baseUrl() . '/friendica',
                        'pubkey'       => $keys['pubkey'],
@@ -1023,7 +1023,7 @@ class User
                                $_SESSION['register'] = 1;
                                $_SESSION['openid'] = $openid_url;
 
-                               $openid = new LightOpenID(DI::baseUrl()->getHostname());
+                               $openid = new LightOpenID(DI::baseUrl()->getHost());
                                $openid->identity = $openid_url;
                                $openid->returnUrl = DI::baseUrl() . '/openid';
                                $openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
@@ -1360,7 +1360,7 @@ class User
                        $l10n,
                        $user,
                        DI::config()->get('config', 'sitename'),
-                       DI::baseUrl()->get(),
+                       DI::baseUrl(),
                        ($register['password'] ?? '') ?: 'Sent in a previous email'
                );
        }
@@ -1457,7 +1457,7 @@ class User
                Thank you and welcome to %4$s.'));
 
                $preamble = sprintf($preamble, $user['username'], DI::config()->get('config', 'sitename'));
-               $body = sprintf($body, DI::baseUrl()->get(), $user['nickname'], $result['password'], DI::config()->get('config', 'sitename'));
+               $body = sprintf($body, DI::baseUrl(), $user['nickname'], $result['password'], DI::config()->get('config', 'sitename'));
 
                $email = DI::emailer()
                        ->newSystemMail()
index 96e82a3fa3e06ebed68d88b3a428d4adf89917a2..aa89ae227508d8fe214bb1b3dd445548cf297cb8 100644 (file)
@@ -59,7 +59,7 @@ class Cookie
         */
        public function __construct(App\Request $request, IManageConfigValues $config, App\BaseURL $baseURL, array $COOKIE = [])
        {
-               $this->sslEnabled     = $baseURL->getSSLPolicy() === App\BaseURL::SSL_POLICY_FULL;
+               $this->sslEnabled     = $baseURL->getScheme() === 'https';
                $this->sitePrivateKey = $config->get('system', 'site_prvkey');
 
                $authCookieDays = $config->get('system', 'auth_cookie_lifetime',
index 7a396949ee5aa62a8073db37f35dc17fa39d713f..34d4609511447a577b32b413badac788dd331ed6 100644 (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);
 
index 6786d89eea1fc4f0db428ed8bf373971b7e41e26..51b900d6113e4510d976d02beba7c4df4a132b70 100644 (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,
index 25e6446fa9ce3f6041cebb2ce798508434c2c182..4ec7a334a9decb0275910bba45e36dd81e00d448 100644 (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),
index cbc34eba7e95fc32f51a3ff745cd95d5a253d246..0142bdd6f197e739a253b54fce57cd7a768a6eb0 100644 (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"),
index 8878895c80b742877ff24934682014636ff0deb8..b9e3b1f64a511515ba80ca300acf91c9618bb196 100644 (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'),
index 7cdbfb4f5107a95b7b07d4a67b7a2f5e33660f1c..34460e1ccebd454955fb2bea958c57dc1c665518 100644 (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'), ""],
index 3cd00e08cabb639bd8ca8624e5101d8494d7f506..cd98ae133618b0084cadf1c16ef230e96bed750e 100644 (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'          => [
index 39dc9f26dae184692b246772c5c4d7ac5f0389d2..f1ef5d7642477e94a73261d5ecd844757fc42e6d 100644 (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],
index ead4f6d83b25b63a21cd36414ec6fd17912b3a3a..8baff7ae243aa630b74a8dfc5156b834338c7bcd 100644 (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,
index b4ea14cf0258ab1b976de78322a75f205569db28..6fea2ac6a53af54283a968c5a6fe56aaa97c393d 100644 (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();
        }
 
 }
index e3ba26e4a30cb57adc8c64b9504b3a1e1311e487..c6bf3dac38427bc92bd09860a71a5ae92d758159 100644 (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,
index 1a7dda3255210bb9e71132bbab0fb0f426be0c45..82539eeb0d8484542f6c808fa5f2c2a7877f1e25 100644 (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"),
                ]);
index 9ffe2ca8feb1d45389e2fab2ba6b321d6dded8ce..69f516a63d0ecdee9115b4a70258ccc84a9218f9 100644 (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),
index 94d155cda43ed0f745532cbff2af0fdbc76f114a..5a8f6aad3084ecd5c2fe8d0fb77ddcda05549a58 100644 (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,
index d68f1a403707933b53a815aaf88a9b08be9ce0f0..a338d3ce7041df03ffe9bccae3528047c198ae99 100644 (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'));
                                }
 
index 3a6e9439be10ec3b4472566b709296c2fe41fd4e..2f367a0aac644278bf0740c7c679c6cf7d46bc44 100644 (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');
index d915fbf69edc758640cec79316c8a852075865f1..959ed71a8debf2c4cc6b20f0e55069a9043a3381 100644 (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"])) {
index bc2f2f402c0e863460f1ed27e93269296a4ced4f..0e378de36e2cbcc8770d88f95f4f5035523bc06a 100644 (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 = '';
index e13fbd584c205a6928212d3d69294ee3315fd9cb..d56655218efa7511f42a984d0307208fa4ad471a 100644 (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) {
index 5457b7442734970785055c99a25f20ca8bdc9a47..6780197555113672bc0522aaf30fcc0361ab3f45 100644 (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
index b07658e5f65bc908d68edcf3273ba55bdbd6859d..519fe751e0b479c2a8680d50b75f6bc4c283bae0 100644 (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>';
index 8f2a98a597582b6e8bd88414387c199db8ce97db..6e1259152f14b349415c5cb2b923e03121fbfdad 100644 (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);
                                }
index bbcccd7dad843a3db3fc798e037cfac17f5b97c2..2c669e886c9e5d74f5e889e50a20b6d85af15fbb 100644 (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);
index a6edd5100f5df1cd1b27c00a9d5116ef4956e9c6..92627125abba940e358e29082426cbce555549eb 100644 (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());
index f0bd6aa9f5845dd8ab8cc4f81738a7d6512634c5..03392c73a6ea5d816b239d196c91f44c3a6c389c 100644 (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;
index 74cc88d30d95d032afd8f74d91ce5fb5f114dc3c..cfafc55251c621cd8fcbfefe78a2f4ae10471d57 100644 (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" />';
                        }
                }
 
index deefc44bbbce0099188db2a50478fe06828b3523..3230dfa3540d71ad02eece29afbb2d153580ec9f 100644 (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')
index 8fa67ec97987431a2758aa01bdb9a8540b894a92..1012dc72baffdbb57fddcb6e69b2ae50e32b7e19 100644 (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.
index 4148b0ddf41ec11381a1c9eb739ce99b8aa14bf0..e98c83a6136b79147d2e772479ee7ae5382fdfd1 100644 (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',
index 2303906dad112286f97c89afe4e0568fa8c5148f..9c0a4a2d09b6e9ffbbaebbd4a671c616958d66cb 100644 (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),
index 7a7d3dacf0e7dd8e3b4e97f40300ebd0d8569f2a..864e1e036bf5519600763ee2b7aa9933b2738ad8 100644 (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')
                ]);
        }
index 62086e7ccd5175da4548ee0d9fb967a500f872df..dee2b87e3b83a4f3d9695349076df6c0e7a5ff5b 100644 (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')
                ]);
        }
index b52641c676f5aeb27a0aee5a0d546febf9ccb9e9..f5ef428a883f8fd316b884f72a211cd269a878fc 100644 (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'),
index 4e6b17bfa55eb62f2ee08f6fdf157dc27547b933..c4805b7b00b8ed98a5f5bf81975737d025e2fe9e 100644 (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,
index 5fac107f09e502aa79f04f2acd3e3d12cad016de..8eef0eaef4510a9e15605bf366cdcc764f916f14 100644 (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,
index 1c8a5cb05df90ecfb40445633a1f8d8f139ee592..48a9b1eef475ece22251c16d889aade6a3b723e9 100644 (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.')],
index 6989af98b0195e5f7e945af8141f04289cbfd087..4781102876b8138feec4ee6550eedf88b559d2a0 100644 (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,
index 5457917db39317b6e08160b84143e6b00612d9c7..0df32c5097982d13fe26103b7161ecfee050ea86 100644 (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,
index f3fc26822c35936065610dceecda0111b8303cbc..40e64bb8af153b5aa70872bc18e0bb11edd501e7 100644 (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,
index 98f114fb344977f21a51d450508d2b32b4533e87..ea55a33f16ba38c5944503bb8495a12a37b49698 100644 (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,
index 15c775d201fa3f78a978e337b95cc33f669db641..3cd4d702010dc9e61c1e702618649e15014aaffa 100644 (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')
                                );
                        }
 
index 36e8713d99b2be0c339ac75e3499b3f2d719c582..f01baafada20beae1a87d42b8ea25e9de0c01efb 100644 (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([
index 92ab321b89f35a4406f8fef86b1739f02471aa3d..6fb44c3002f12ac5833245414ed468c6944adba3 100644 (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);
 
index b6d5fa182ffd9dda2cf9c1617edc693dfa2d6b13..cc4f134414d8df24cd13581885340887a66d0276 100644 (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'),
index 8fd64a17a8e5f4a9979c3b25c9243bb1e22473d7..8393327251ad3c647ed70a08a52cb203bd961273 100644 (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:')
                ]);
index d76094003feaabb78a60cd36d017782543c7c1c1..6d608063e73072284e4a5eaf52a4c9e840b2d014 100644 (file)
@@ -48,7 +48,7 @@ class ReallySimpleDiscovery extends BaseModule
                                                        '@attributes' => [
                                                                'name'      => 'Twitter',
                                                                'preferred' => 'true',
-                                                               'apiLink'   => DI::baseUrl()->get(),
+                                                               'apiLink'   => DI::baseUrl(),
                                                                'blogID'    => '',
                                                        ],
                                                        'settings'    => [
index 6b21a0c7e784d7d688165abc547ec0ff2047802d..e5c5840d22dc2a30dfc1bf01b74d383d44d765fe 100644 (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
                        ]);
index d1da83b2c9fa76f39e71a814c1d4519d678bff8b..634123a8e3e07cc05527051ac67235bcec54919c 100644 (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'),
 
index b3f869e2f1bf7cccbb40d63fbe1b89a3137ddf85..e0a13954dd9b55b5ad738816663d1a086ac88c76 100644 (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));
 
index 53fafea41e4e609d8349e9f3804a088e0a5b0b79..b4117a50602f82b73009d2b1424f35095e0662d6 100644 (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'] ?? '',
 
index f8f65e72067d4199a1db58e90a51afa21274eb6c..4e756a849d7fc849cc0ea876cd86ed28a92cab47 100644 (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',
index cb9ec09ee31f1f162bb514568df912da251dca50..c614eccd04277f97ed7f17b94ee43c49f75ecec0 100644 (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],
index 00f4075b063aaea0d13950eec457e78c09cfa725..50ac3e95dc2756e9134a88aa04b0727d32e5bb82 100644 (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'),
index 450be03315ddfdaaa1629adc2afac56f8a182597..baf4a71f31e632212c10687ce524b32c4e02c09f 100644 (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']],
index 512ff8dd0e5666bf2f67aa61fd98a403b45ea4f1..75976ac36b325576c7f8a0e070e108e5099562b5 100644 (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',
index e1c486c2eb9402043994396bee6b3ff3a7ab822c..9ae641d41d8b909491b16267919b853cde3a91b2 100644 (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'],
                        ]
                ];
 
index 4ee495984f03133d713ffb6e91c9445b67b814e0..11835ec351d413e7a4ff60d526d6d24775971c87 100644 (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);
index ad2b25902567d238f1d5f663366f162140d9f251..098d69e23cb2b579879977f5b97bbf585470c666 100644 (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' => [
index 638640321bc234e4aede027af3ba1d865c447df7..b4e48172c5d75f26a25349eeccfee0b8f52a196a 100644 (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)
                );
        }
 }
index aa2ff1d91a24403ce95176371086b62dd428fe28..792bf91d317684169e90e544815f4dc8a87eaa73 100644 (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');
index 1b8dda48dd6f9cb58ceb46347773e45a8b41b685..bc5affd696457953fbad755e8afc339233d46293 100644 (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',
index 2d15dd85c19389fa113172f18d360852c324c36e..d1256f7d9fed93be369178d4c42e86f92f4c0318 100644 (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);
index 5d01d3e1268a86aabde5213a5303217eedf916c1..65f90dab836b9f7072794905de144de9fc4d2e3a 100644 (file)
@@ -90,7 +90,7 @@ class HttpClient extends BaseFactory
                                         App::CODENAME . "' " .
                                         App::VERSION . '-' .
                                         DB_UPDATE_VERSION . '; ' .
-                                        $this->baseUrl->get();
+                                        $this->baseUrl;
 
                $guzzle = new GuzzleHttp\Client([
                        RequestOptions::ALLOW_REDIRECTS => [
index 4a1e1ba77820371c560388262ec672e73b2a896e..88c256fe08d9975046423a67887672424b95bee9 100644 (file)
@@ -178,7 +178,7 @@ class Probe
         */
        private static function ownHost(string $host): bool
        {
-               $own_host = DI::baseUrl()->getHostname();
+               $own_host = DI::baseUrl()->getHost();
 
                $parts = parse_url($host);
 
index 958e95c178ce3d756cf0bf4ae95035435437e067..5a66209777c37c3469da55f13ea60b8de3402512 100644 (file)
@@ -95,7 +95,7 @@ class Account extends BaseDataTransferObject
                $this->id              = (string)$account['pid'];
                $this->username        = $account['nick'];
                $this->acct            =
-                       strpos($account['url'], $baseUrl->get() . '/') === 0 ?
+                       strpos($account['url'], $baseUrl . '/') === 0 ?
                                $account['nick'] :
                                $account['addr'];
                $this->display_name    = $account['name'];
index 14914cd7fc79238b1bbc02a7ac4ed70bff9fe98f..b6239550a8f80e875afa486becdd4487b96bf50a 100644 (file)
@@ -84,14 +84,14 @@ class Instance extends BaseDataTransferObject
        {
                $register_policy = intval($config->get('config', 'register_policy'));
 
-               $this->uri               = $baseUrl->get();
+               $this->uri               = $baseUrl;
                $this->title             = $config->get('config', 'sitename');
                $this->short_description = $this->description = $config->get('config', 'info');
                $this->email             = implode(',', User::getAdminEmailList());
                $this->version           = '2.8.0 (compatible; Friendica ' . App::VERSION . ')';
                $this->urls              = null; // Not supported
                $this->stats             = new Stats($config, $database);
-               $this->thumbnail         = $baseUrl->get() . 'images/friendica-banner.jpg';
+               $this->thumbnail         = $baseUrl . 'images/friendica-banner.jpg';
                $this->languages         = [$config->get('system', 'language')];
                $this->max_toot_chars    = (int)$config->get('config', 'api_import_size', $config->get('config', 'max_import_size'));
                $this->registrations     = ($register_policy != Register::CLOSED);
index 6ff1c987f42510d6eeabc580b53b9cde5c6d8270..dca2c44f91ce8c81a6909bf8c65d69a0e0403ef7 100644 (file)
@@ -56,7 +56,7 @@ class Mention extends BaseDataTransferObject
 
                if (!empty($contact)) {
                        $this->acct =
-                               strpos($contact['url'], $baseUrl->get() . '/') === 0 ?
+                               strpos($contact['url'], $baseUrl . '/') === 0 ?
                                        $contact['nick'] :
                                        $contact['addr'];
 
index 4b63463b487b763193c313dadd5522fbf2faecee..02dc7ff544ef8c636f52dde0ab84cca0efdcff74 100644 (file)
@@ -330,7 +330,7 @@ class Transmitter
                return [
                        'type' => 'Service',
                        'name' =>  App::PLATFORM . " '" . App::CODENAME . "' " . App::VERSION . '-' . DB_UPDATE_VERSION,
-                       'url' => DI::baseUrl()->get()
+                       'url' => DI::baseUrl()
                ];
        }
 
index a4fe943da573780b3b5307c3b1f181c460fe70dc..c8039344ede14c9f68824aa466705261de35ecd3 100644 (file)
@@ -161,7 +161,7 @@ class Delivery
                        // if $parent['wall'] == 1 we will already have the parent message in our array
                        // and we will relay the whole lot.
 
-                       $localhost = DI::baseUrl()->getHostname();
+                       $localhost = DI::baseUrl()->getHost();
                        if (strpos($localhost, ':')) {
                                $localhost = substr($localhost, 0, strpos($localhost, ':'));
                        }
@@ -556,7 +556,7 @@ class Delivery
                                $headers = 'From: ' . Email::encodeHeader($local_user['username'],'UTF-8') . ' <' . $local_user['email'] . '>' . "\n";
                        }
                } else {
-                       $sender  = DI::config()->get('config', 'sender_email', 'noreply@' . DI::baseUrl()->getHostname());
+                       $sender  = DI::config()->get('config', 'sender_email', 'noreply@' . DI::baseUrl()->getHost());
                        $headers = 'From: '. Email::encodeHeader($local_user['username'], 'UTF-8') . ' <' . $sender . '>' . "\n";
                }
 
index f7bc282c1e810ecd6fbe0fd48ab082ebb83daa93..7d778ee582bb2836486147b418d10e291c800b83 100644 (file)
@@ -629,7 +629,7 @@ class Feed
                        // Distributed items should have a well-formatted URI.
                        // Additionally, we have to avoid conflicts with identical URI between imported feeds and these items.
                        if ($notify) {
-                               $item['guid'] = Item::guidFromUri($orig_plink, DI::baseUrl()->getHostname());
+                               $item['guid'] = Item::guidFromUri($orig_plink, DI::baseUrl()->getHost());
                                $item['uri']  = Item::newURI($item['guid']);
                                unset($item['plink']);
                                unset($item['thr-parent']);
index 2a160724b4d0ea16cdbd55de357c6c4860875371..80644329ff4d857fc05269ce23e10be935214316 100644 (file)
@@ -1395,8 +1395,8 @@ class OStatus
                }
 
                $item['uri'] = $item['parent-uri'] = $item['thr-parent']
-                               = 'tag:' . DI::baseUrl()->getHostname().
-                               ','.date('Y-m-d').':'.$action.':'.$owner['uid'].
+                               = 'tag:' . DI::baseUrl()->getHost() .
+                                 ','.date('Y-m-d').':'.$action.':'.$owner['uid'].
                                ':person:'.$connect_id.':'.$item['created'];
 
                $item['body'] = sprintf($message, $owner['nick'], $contact['nick']);
index d21e0bcef34d0be247ac72162a6ca1a53322d4d6..4db5fdfed56242fd4dccd4d1c6b92dbb8343b1dc 100644 (file)
@@ -230,11 +230,11 @@ class Authentication
 
                // Otherwise it's probably an openid.
                try {
-                       $openid           = new LightOpenID($this->baseUrl->getHostname());
+                       $openid           = new LightOpenID($this->baseUrl->getHost());
                        $openid->identity = $openid_url;
                        $this->session->set('openid', $openid_url);
                        $this->session->set('remember', $remember);
-                       $openid->returnUrl = $this->baseUrl->get(true) . '/openid';
+                       $openid->returnUrl = $this->baseUrl . '/openid';
                        $openid->optional  = ['namePerson/friendly', 'contact/email', 'namePerson', 'namePerson/first', 'media/image/aspect11', 'media/image/default'];
                        System::externalRedirect($openid->authUrl());
                } catch (Exception $e) {
@@ -329,8 +329,8 @@ class Authentication
                        'mobile-theme'  => $this->pConfig->get($user_record['uid'], 'system', 'mobile_theme'),
                        'authenticated' => 1,
                        'page_flags'    => $user_record['page-flags'],
-                       'my_url'        => $this->baseUrl->get() . '/profile/' . $user_record['nickname'],
-                       'my_address'    => $user_record['nickname'] . '@' . substr($this->baseUrl->get(), strpos($this->baseUrl->get(), '://') + 3),
+                       'my_url'        => $this->baseUrl . '/profile/' . $user_record['nickname'],
+                       'my_address'    => $user_record['nickname'] . '@' . substr($this->baseUrl, strpos($this->baseUrl, '://') + 3),
                        'addr'          => $this->remoteAddress,
                        'nickname'      => $user_record['nickname'],
                ]);
index 602acb0cb1bf72fd33dfc912d7f8b30dc1108d38..af04e80131bd53896d944c75808d0918c189400c 100644 (file)
@@ -201,7 +201,7 @@ class ExAuth
                $sUser = str_replace(['%20', '(a)'], [' ', '@'], $aCommand[1]);
 
                // Does the hostname match? So we try directly
-               if ($this->baseURL->getHostname() == $aCommand[2]) {
+               if ($this->baseURL->getHost() == $aCommand[2]) {
                        $this->writeLog(LOG_INFO, 'internal user check for ' . $sUser . '@' . $aCommand[2]);
                        $found = $this->dba->exists('user', ['nickname' => $sUser]);
                } else {
@@ -282,7 +282,7 @@ class ExAuth
 
                $Error = false;
                // Does the hostname match? So we try directly
-               if ($this->baseURL->getHostname() == $aCommand[2]) {
+               if ($this->baseURL->getHost() == $aCommand[2]) {
                        try {
                                $this->writeLog(LOG_INFO, 'internal auth for ' . $sUser . '@' . $aCommand[2]);
                                User::getIdFromPasswordAuthentication($sUser, $aCommand[3], true);
index 1310fee8748cef2005cf877ccaf701dd88d7ac5e..96e3a0928eb453f08844474e7fa0f34679a73382 100644 (file)
@@ -72,7 +72,7 @@ abstract class MailBuilder
                $this->config  = $config;
                $this->logger  = $logger;
 
-               $hostname = $baseUrl->getHostname();
+               $hostname = $baseUrl->getHost();
                if (strpos($hostname, ':')) {
                        $hostname = substr($hostname, 0, strpos($hostname, ':'));
                }
@@ -83,7 +83,7 @@ abstract class MailBuilder
                        'X-Friendica-Platform' => [App::PLATFORM],
                        'X-Friendica-Version'  => [App::VERSION],
                        'List-ID'              => ['<notification.' . $hostname . '>'],
-                       'List-Archive'         => ['<' . $baseUrl->get() . '/notifications/system>'],
+                       'List-Archive'         => ['<' . $baseUrl . '/notifications/system>'],
                ];
        }
 
@@ -262,7 +262,7 @@ abstract class MailBuilder
                                '$htmlversion' => $msgHtml,
                                '$sitename'    => $this->config->get('config', 'sitename'),
                                '$banner'      => $this->config->get('system', 'email_banner',
-                                       $this->baseUrl->get(true) . DIRECTORY_SEPARATOR . self::DEFAULT_EMAIL_BANNER),
+                                       $this->baseUrl . DIRECTORY_SEPARATOR . self::DEFAULT_EMAIL_BANNER),
                        ]);
                }
 
index d1973237d12cc2bd5d60777e429b019b0ba62f49..5e4d98d4c9e83e18ca46ebac609dd7e7d1b76658 100644 (file)
@@ -65,7 +65,7 @@ class Emailer
 
                $this->siteEmailAddress = $this->config->get('config', 'sender_email');
                if (empty($this->siteEmailAddress)) {
-                       $hostname = $this->baseUrl->getHostname();
+                       $hostname = $this->baseUrl->getHost();
                        if (strpos($hostname, ':')) {
                                $hostname = substr($hostname, 0, strpos($hostname, ':'));
                        }
index f42a832b37a56179888a540cd3514114773efdbc..81007b2372bdb4b5a18f375805cab7bfb5be62c2 100644 (file)
@@ -33,7 +33,7 @@ class NodeInfo
                Logger::info('start');
                ModelNodeInfo::update();
                // Now trying to register
-               $url = 'http://the-federation.info/register/' . DI::baseUrl()->getHostname();
+               $url = 'http://the-federation.info/register/' . DI::baseUrl()->getHost();
                Logger::debug('Check registering url', ['url' => $url]);
                $ret = DI::httpClient()->fetch($url, HttpClientAccept::HTML);
                Logger::debug('Check registering answer', ['answer' => $ret]);
index e4189c2c75c4b2fb12e1c09c8d2a8ff466c734f9..93c6c180ab125b339a7328db8d227cb1177960ee 100644 (file)
@@ -212,7 +212,7 @@ class Notifier
                        // if $parent['wall'] == 1 we will already have the parent message in our array
                        // and we will relay the whole lot.
 
-                       $localhost = str_replace('www.','', DI::baseUrl()->getHostname());
+                       $localhost = str_replace('www.','', DI::baseUrl()->getHost());
                        if (strpos($localhost,':')) {
                                $localhost = substr($localhost,0,strpos($localhost,':'));
                        }
index 895a0d0d2d3f45c23dd7aa075e7a468b1b401fdb..17b47f1cbd8388dc512e1846e6868e518890e1b4 100644 (file)
@@ -115,7 +115,7 @@ class PushSubscription
 
                $auth = [
                        'VAPID' => [
-                               'subject'    => DI::baseUrl()->getHostname(),
+                               'subject'    => DI::baseUrl()->getHost(),
                                'publicKey'  => ModelSubscription::getPublicVapidKey(),
                                'privateKey' => ModelSubscription::getPrivateVapidKey(),
                        ],
index c6092393bdab5989bd93e2ce9785b2e166258f2b..0677ff900a24da499bfd49eda4d6a0db3a9d00e6 100644 (file)
@@ -35,7 +35,7 @@ if (!isset($minimal)) {
        $minimal = false;
 }
 
-$basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/";
+$basepath = DI::baseUrl()->getPath() ? "/" . DI::baseUrl()->getPath() . "/" : "/";
 $frio = "view/theme/frio";
 $view_mode_class = (DI::mode()->isMobile() || DI::mode()->isMobile()) ? 'mobile-view' : 'desktop-view';
 $is_singleuser = DI::config()->get('system', 'singleuser');
index 994fe8c8562831626344731a4f1fb30ff82c6eea..c87ec9abe19a3e8ceb0654e5e3b119b4a434e9d3 100644 (file)
@@ -1,4 +1,30 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ * Name: Vier
+ * Version: 1.2
+ * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
+ * Author: Ike <http://pirati.ca/profile/heluecht>
+ * Author: Beanow <https://fc.oscp.info/profile/beanow>
+ * Maintainer: Ike <http://pirati.ca/profile/heluecht>
+ * Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
+ */
 
 /*
  * Name: Smoothly
@@ -23,7 +49,7 @@ function smoothly_init(App $a) {
 
        $cssFile = null;
        $ssl_state = false;
-       $baseurl = DI::baseUrl()->get($ssl_state);
+       $baseurl = DI::baseUrl();
        DI::page()['htmlhead'] .= <<< EOT
 
 <script>
@@ -90,7 +116,7 @@ if (! function_exists('_js_in_foot')) {
                /** @purpose insert stuff in bottom of page
                */
                $ssl_state = false;
-               $baseurl = DI::baseUrl()->get($ssl_state);
+               $baseurl = DI::baseUrl();
                $bottom['$baseurl'] = $baseurl;
                $tpl = Renderer::getMarkupTemplate('bottom.tpl');