parameters and getURLpath to getURLPath
This commit is contained in:
parent
3eb4332f33
commit
307286fc47
12 changed files with 22 additions and 22 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -50,7 +50,7 @@ function hcard_init(App $a)
|
|||
|
||||
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/dfrn_poll/' . $which .'" />' . "\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'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
|
||||
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ function profile_init(App $a)
|
|||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\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'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
|
||||
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLpath(), System::baseUrl() . '/profile/' . $nickname),
|
||||
'$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname),
|
||||
'$basepath' => $a->getHostName()
|
||||
]);
|
||||
|
||||
|
|
|
@ -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') {
|
||||
|
|
14
src/App.php
14
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;
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -26,7 +26,7 @@ if (!isset($minimal)) {
|
|||
<script type="text/javascript">var baseurl = "<?php echo System::baseUrl(); ?>";</script>
|
||||
<script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
|
||||
<?php
|
||||
$basepath = $a->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
|
||||
|
|
Loading…
Reference in a new issue