parameters and getURLpath to getURLPath
authorPhilipp Holzer <admin@philipp.info>
Tue, 9 Oct 2018 23:18:47 +0000 (01:18 +0200)
committerPhilipp Holzer <admin@philipp.info>
Tue, 9 Oct 2018 23:18:47 +0000 (01:18 +0200)
12 files changed:
mod/admin.php
mod/dfrn_request.php
mod/hcard.php
mod/profile.php
mod/redir.php
mod/settings.php
mod/xrd.php
src/App.php
src/Core/NotificationsManager.php
src/Model/Contact.php
src/Module/Magic.php
view/theme/frio/php/default.php

index f186f12..bd5e9ec 100644 (file)
@@ -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);
 
index 4971cb8..e611458 100644 (file)
@@ -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);
index 11e5475..7e5c2cc 100644 (file)
@@ -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);
 
index c57f403..aa284d1 100644 (file)
@@ -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);
 
index b9a2421..e989ad0 100644 (file)
@@ -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
index 3a6c8c3..5632193 100644 (file)
@@ -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()
        ]);
 
index 801fa9d..2626b0c 100644 (file)
@@ -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') {
index e947c13..e94067a 100644 (file)
@@ -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;
                }
index 4f5ccb9..fb77605 100644 (file)
@@ -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',
index ab427ef..23c31d0 100644 (file)
@@ -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());
index 5bf176b..042a958 100644 (file)
@@ -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.
index bf4aa2d..aa86c97 100644 (file)
@@ -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