mirror of
https://github.com/friendica/friendica
synced 2025-04-22 12:30:12 +00:00
Merge pull request #12802 from nupplaphil/feat/system_url_handling
Transform BaseURL to URIInterface conform class with less business logic
This commit is contained in:
commit
ee5acc29c3
128 changed files with 829 additions and 1471 deletions
|
@ -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'];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue