From 307286fc475e241f32ebd11bb3ba1d42761995e3 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Wed, 10 Oct 2018 01:18:47 +0200 Subject: [PATCH] parameters and getURLpath to getURLPath --- mod/admin.php | 4 ++-- mod/dfrn_request.php | 6 +++--- mod/hcard.php | 2 +- mod/profile.php | 2 +- mod/redir.php | 2 +- mod/settings.php | 2 +- mod/xrd.php | 4 ++-- src/App.php | 14 +++++++------- src/Core/NotificationsManager.php | 2 +- src/Model/Contact.php | 2 +- src/Module/Magic.php | 2 +- view/theme/frio/php/default.php | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index f186f127ad..bd5e9ecea3 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1124,7 +1124,7 @@ function admin_page_site_post(App $a) Worker::add(PRIORITY_LOW, 'Directory'); } - if ($a->getURLpath() != "") { + if ($a->getURLPath() != "") { $diaspora_enabled = false; } if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) { @@ -1421,7 +1421,7 @@ function admin_page_site(App $a) if (empty(Config::get('config', 'hostname'))) { Config::set('config', 'hostname', $a->getHostName()); } - $diaspora_able = ($a->getURLpath() == ""); + $diaspora_able = ($a->getURLPath() == ""); $optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1); diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 4971cb8609..e611458281 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -453,8 +453,8 @@ function dfrn_request_post(App $a) if ($network == Protocol::DIASPORA) { $uri = $nickname . '@' . $a->getHostName(); - if ($a->getURLpath()) { - $uri .= '/' . $a->getURLpath(); + if ($a->getURLPath()) { + $uri .= '/' . $a->getURLPath(); } $uri = urlencode($uri); @@ -609,7 +609,7 @@ function dfrn_request_content(App $a) } elseif (x($_GET, 'address') && ($_GET['address'] != "")) { $myaddr = $_GET['address']; } elseif (local_user()) { - if (strlen($a->getURLpath())) { + if (strlen($a->getURLPath())) { $myaddr = System::baseUrl() . '/profile/' . $a->user['nickname']; } else { $myaddr = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3); diff --git a/mod/hcard.php b/mod/hcard.php index 11e5475f43..7e5c2cc08a 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -50,7 +50,7 @@ function hcard_init(App $a) $a->page['htmlhead'] .= '' . "\r\n" ; $a->page['htmlhead'] .= '' . "\r\n" ; - $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . (($a->getURLpath()) ? '/' . $a->getURLpath() : '')); + $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . (($a->getURLPath()) ? '/' . $a->getURLPath() : '')); $a->page['htmlhead'] .= '' . "\r\n"; header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); diff --git a/mod/profile.php b/mod/profile.php index c57f403930..aa284d1669 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -91,7 +91,7 @@ function profile_init(App $a) $a->page['htmlhead'] .= '' . "\r\n"; $a->page['htmlhead'] .= '' . "\r\n"; $a->page['htmlhead'] .= '' . "\r\n"; - $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . ($a->getURLpath() ? '/' . $a->getURLpath() : '')); + $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->getHostName() . ($a->getURLPath() ? '/' . $a->getURLPath() : '')); $a->page['htmlhead'] .= '' . "\r\n"; header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); diff --git a/mod/redir.php b/mod/redir.php index b9a24210b6..e989ad015a 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -57,7 +57,7 @@ function redir_init(App $a) { } if (remote_user()) { - $host = substr(System::baseUrl() . ($a->getURLpath() ? '/' . $a->getURLpath() : ''), strpos(System::baseUrl(), '://') + 3); + $host = substr(System::baseUrl() . ($a->getURLPath() ? '/' . $a->getURLPath() : ''), strpos(System::baseUrl(), '://') + 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 3a6c8c3fab..5632193e3b 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1136,7 +1136,7 @@ function settings_content(App $a) $tpl_addr = get_markup_template('settings/nick_set.tpl'); $prof_addr = replace_macros($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() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname), '$basepath' => $a->getHostName() ]); diff --git a/mod/xrd.php b/mod/xrd.php index 801fa9d91b..2626b0c791 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -56,8 +56,8 @@ function xrd_init(App $a) $alias = str_replace('/profile/', '/~', $profile_url); $addr = 'acct:'.$user['nickname'].'@'.$a->getHostName(); - if ($a->getURLpath()) { - $addr .= '/'.$a->getURLpath(); + if ($a->getURLPath()) { + $addr .= '/'.$a->getURLPath(); } if ($mode == 'xml') { diff --git a/src/App.php b/src/App.php index e947c13ffb..e94067a08f 100644 --- a/src/App.php +++ b/src/App.php @@ -673,7 +673,7 @@ class App $this->hostname = Config::get('config', 'hostname'); } - return $scheme . '://' . $this->hostname . (!empty($this->getURLpath()) ? '/' . $this->getURLpath() : '' ); + return $scheme . '://' . $this->hostname . (!empty($this->getURLPath()) ? '/' . $this->getURLPath() : '' ); } /** @@ -727,7 +727,7 @@ class App return $this->hostname; } - public function getURLpath() + public function getURLPath() { return $this->urlpath; } @@ -873,20 +873,20 @@ class App /** * @brief Removes the base url from an url. This avoids some mixed content problems. * - * @param string $orig_url + * @param string $origURL * * @return string The cleaned url */ - public function removeBaseURL($orig_url) + public function removeBaseURL($origURL) { // Remove the hostname from the url if it is an internal link - $nurl = normalise_link($orig_url); + $nurl = normalise_link($origURL); $base = normalise_link($this->getBaseURL()); $url = str_replace($base . '/', '', $nurl); // if it is an external link return the orignal value - if ($url == normalise_link($orig_url)) { - return $orig_url; + if ($url == normalise_link($origURL)) { + return $origURL; } else { return $url; } diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index 4f5ccb95a0..fb77605730 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -631,7 +631,7 @@ class NotificationsManager extends BaseObject // We have to distinguish between these two because they use different data. // Contact suggestions if ($it['fid']) { - $return_addr = bin2hex(self::getApp()->user['nickname'] . '@' . self::getApp()->getHostName() . ((self::getApp()->getURLpath()) ? '/' . self::getApp()->getURLpath() : '')); + $return_addr = bin2hex(self::getApp()->user['nickname'] . '@' . self::getApp()->getHostName() . ((self::getApp()->getURLPath()) ? '/' . self::getApp()->getURLPath() : '')); $intro = [ 'label' => 'friend_suggestion', diff --git a/src/Model/Contact.php b/src/Model/Contact.php index ab427efab9..23c31d0b17 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1632,7 +1632,7 @@ class Contact extends BaseObject if (($ret['network'] === Protocol::DFRN) && !DBA::isResult($contact)) { if ($interactive) { - if (strlen($a->getURLpath())) { + if (strlen($a->getURLPath())) { $myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']); } else { $myaddr = bin2hex($a->user['nickname'] . '@' . $a->getHostName()); diff --git a/src/Module/Magic.php b/src/Module/Magic.php index 5bf176b251..042a9581df 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -78,7 +78,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() . ($a->getURLPath() ? '/' . $a->getURLPath() : '') ); // Try to get an authentication token from the other instance. diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index bf4aa2df46..aa86c97238 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -26,7 +26,7 @@ if (!isset($minimal)) { getURLpath() ? "/" . $a->getURLpath() . "/" : "/"; + $basepath = $a->getURLPath() ? "/" . $a->getURLPath() . "/" : "/"; $frio = "view/theme/frio"; // Because we use minimal for modals the header and the included js stuff should be only loaded -- 2.39.5