Remove deprecated App::getHostName() - process methods to DI::baseUrl()->getHostName()
This commit is contained in:
@@ -2269,7 +2269,7 @@ class Contact
|
||||
if (strlen(DI::baseUrl()->getUrlPath())) {
|
||||
$myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']);
|
||||
} else {
|
||||
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->getHostName());
|
||||
$myaddr = bin2hex($a->user['nickname'] . '@' . DI::baseUrl()->getHostname());
|
||||
}
|
||||
|
||||
DI::baseUrl()->redirect($ret['request'] . "&addr=$myaddr");
|
||||
|
||||
@@ -1279,7 +1279,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 = \get_app()->getHostName();
|
||||
$prefix_host = DI::baseUrl()->getHostname();
|
||||
} else {
|
||||
$prefix_host = '';
|
||||
|
||||
@@ -2752,8 +2752,6 @@ class Item
|
||||
|
||||
public static function isRemoteSelf($contact, &$datarray)
|
||||
{
|
||||
$a = \get_app();
|
||||
|
||||
if (!$contact['remote_self']) {
|
||||
return false;
|
||||
}
|
||||
@@ -2765,7 +2763,7 @@ class Item
|
||||
}
|
||||
|
||||
// Prevent to forward already forwarded posts
|
||||
if ($datarray["app"] == $a->getHostName()) {
|
||||
if ($datarray["app"] == DI::baseUrl()->getHostname()) {
|
||||
Logger::log('Already forwarded (second test)', Logger::DEBUG);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ use Friendica\Core\System;
|
||||
use Friendica\Core\Theme;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
@@ -1175,7 +1176,7 @@ class Profile
|
||||
|
||||
$a->contact = $arr['visitor'];
|
||||
|
||||
info(L10n::t('OpenWebAuth: %1$s welcomes %2$s', $a->getHostName(), $visitor['name']));
|
||||
info(L10n::t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
|
||||
|
||||
Logger::log('OpenWebAuth: auth success from ' . $visitor['addr'], Logger::DEBUG);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\TwoFactor\AppSpecificPassword;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Crypto;
|
||||
@@ -587,7 +588,6 @@ class User
|
||||
*/
|
||||
public static function create(array $data)
|
||||
{
|
||||
$a = \get_app();
|
||||
$return = ['user' => null, 'password' => ''];
|
||||
|
||||
$using_invites = Config::get('system', 'invitation_only');
|
||||
@@ -633,7 +633,7 @@ class User
|
||||
$_SESSION['register'] = 1;
|
||||
$_SESSION['openid'] = $openid_url;
|
||||
|
||||
$openid = new LightOpenID($a->getHostName());
|
||||
$openid = new LightOpenID(DI::baseUrl()->getHostname());
|
||||
$openid->identity = $openid_url;
|
||||
$openid->returnUrl = System::baseUrl() . '/openid';
|
||||
$openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
|
||||
|
||||
Reference in New Issue
Block a user