From: nupplaPhil Date: Sun, 15 Dec 2019 23:39:54 +0000 (+0100) Subject: Remove deprecated App::getUrlPath - process methods to DI::baseUrl()->getUrlPath() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=29003896960760c7fe4ed34dddf99c9bb629c3f0;p=friendica.git Remove deprecated App::getUrlPath - process methods to DI::baseUrl()->getUrlPath() --- diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index f7c9d9aafc..24548c027a 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -457,8 +457,8 @@ function dfrn_request_post(App $a) if ($network == Protocol::DIASPORA) { $uri = $nickname . '@' . $a->getHostName(); - if ($a->getURLPath()) { - $uri .= '/' . $a->getURLPath(); + if (DI::baseUrl()->getUrlPath()) { + $uri .= '/' . DI::baseUrl()->getUrlPath(); } $uri = urlencode($uri); @@ -610,7 +610,7 @@ function dfrn_request_content(App $a) } elseif (!empty($_GET['address'])) { $myaddr = $_GET['address']; } elseif (local_user()) { - if (strlen($a->getURLPath())) { + if (strlen(DI::baseUrl()->getUrlPath())) { $myaddr = System::baseUrl() . '/profile/' . $a->user['nickname']; } else { $myaddr = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3); diff --git a/mod/redir.php b/mod/redir.php index 57f96a7ac6..6083117b40 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -60,7 +60,7 @@ function redir_init(App $a) { } if (remote_user()) { - $host = substr($a->getBaseURL() . ($a->getURLPath() ? '/' . $a->getURLPath() : ''), strpos($a->getBaseURL(), '://') + 3); + $host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3); $remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1); // On a local instance we have to check if the local user has already authenticated diff --git a/mod/settings.php b/mod/settings.php index 416a8adcda..c01d179388 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1127,7 +1127,7 @@ function settings_content(App $a) $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl'); $prof_addr = Renderer::replaceMacros($tpl_addr,[ - '$desc' => L10n::t("Your Identity Address is '%s' or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname), + '$desc' => L10n::t("Your Identity Address is '%s' or '%s'.", $nickname . '@' . $a->getHostName() . DI::baseUrl()->getUrlPath(), System::baseUrl() . '/profile/' . $nickname), '$basepath' => $a->getHostName() ]); diff --git a/src/App.php b/src/App.php index d04c6f3235..01702967e2 100644 --- a/src/App.php +++ b/src/App.php @@ -311,18 +311,6 @@ class App return $this->baseURL->getHostname(); } - /** - * Returns the sub-path of the full URL - * - * @return string - * - * @deprecated 2019.06 - use BaseURL->getUrlPath() instead - */ - public function getURLPath() - { - return $this->baseURL->getUrlPath(); - } - /** * Returns the current UserAgent as a String * diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 8d4b8c6312..f06156d01e 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2266,7 +2266,7 @@ class Contact if (($protocol === Protocol::DFRN) && !DBA::isResult($contact)) { if ($interactive) { - if (strlen($a->getURLPath())) { + if (strlen(DI::baseUrl()->getUrlPath())) { $myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']); } else { $myaddr = bin2hex($a->user['nickname'] . '@' . $a->getHostName()); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 42b35edff3..6467bd4c52 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -242,7 +242,7 @@ class Site extends BaseAdminModule Worker::add(PRIORITY_LOW, 'Directory'); } - if ($a->getURLPath() != "") { + if (DI::baseUrl()->getUrlPath() != "") { $diaspora_enabled = false; } if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) { @@ -523,7 +523,7 @@ class Site extends BaseAdminModule 'develop' => L10n::t('check the development version') ]; - $diaspora_able = ($a->getURLPath() == ''); + $diaspora_able = (DI::baseUrl()->getUrlPath() == ''); $optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1); diff --git a/src/Module/Magic.php b/src/Module/Magic.php index d34f7e8744..b0d2b82b28 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -80,7 +80,7 @@ class Magic extends BaseModule $headers = HTTPSignature::createSig( $headers, $user['prvkey'], - 'acct:' . $user['nickname'] . '@' . $a->getHostName() . ($a->getURLPath() ? '/' . $a->getURLPath() : '') + 'acct:' . $user['nickname'] . '@' . $a->getHostName() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : '') ); // Try to get an authentication token from the other instance. diff --git a/src/Module/Profile.php b/src/Module/Profile.php index 0515d22e18..cbb953dd75 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -120,7 +120,7 @@ class Profile extends BaseModule $a->page['htmlhead'] .= '' . "\n"; $a->page['htmlhead'] .= '' . "\n"; $a->page['htmlhead'] .= '' . "\n"; - $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . ($a->getURLPath() ? '/' . $a->getURLPath() : '')); + $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : '')); $a->page['htmlhead'] .= '' . "\n"; header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 6b39e68acb..73ceea5845 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -10,6 +10,7 @@ use Friendica\Core\Config; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\Profile; require_once 'view/theme/frio/php/frio_boot.php'; @@ -19,7 +20,7 @@ if (!isset($minimal)) { $minimal = false; } -$basepath = $a->getURLPath() ? "/" . $a->getURLPath() . "/" : "/"; +$basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/"; $frio = "view/theme/frio"; $view_mode_class = ($a->is_mobile || $a->is_tablet) ? 'mobile-view' : 'desktop-view'; $is_singleuser = Config::get('system', 'singleuser');