Ensure that the baseurl return value is a string

This commit is contained in:
Michael 2023-05-11 08:13:19 +00:00
parent 4c40bc164d
commit e13a31c4fe
12 changed files with 15 additions and 21 deletions

View file

@ -64,9 +64,9 @@ class HCard extends BaseModule
$page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
}
$baseUrl = DI::baseUrl();
$baseUrl = (string)DI::baseUrl();
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHost() . ($baseUrl->getPath() ? '/' . $baseUrl->getPath() : ''));
$uri = urlencode('acct:' . $profile['nickname'] . '@' . DI::baseUrl()->getHost() . (DI::baseUrl()->getPath() ? '/' . DI::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 . '/dfrn_poll/' . $nickname . '" />' . "\r\n";

View file

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

View file

@ -298,7 +298,7 @@ class Register extends BaseModule
$user = $result['user'];
$base_url = DI::baseUrl();
$base_url = (string)DI::baseUrl();
if ($netpublish && intval(DI::config()->get('config', 'register_policy')) !== self::APPROVE) {
$url = $base_url . '/profile/' . $user['nickname'];

View file

@ -46,7 +46,7 @@ class HostMeta extends BaseModule
$config->set('system', 'site_pubkey', $res['pubkey']);
}
$domain = DI::baseUrl();
$domain = (string)DI::baseUrl();
XML::fromArray([
'XRD' => [