]> git.mxchange.org Git - friendica.git/commitdiff
replaced $return_url to $return_path to make it more clear that it is a relative...
authorPhilipp Holzer <admin@philipp.info>
Fri, 19 Oct 2018 21:55:11 +0000 (23:55 +0200)
committerPhilipp Holzer <admin@philipp.info>
Mon, 22 Oct 2018 20:13:37 +0000 (22:13 +0200)
12 files changed:
include/conversation.php
mod/events.php
mod/follow.php
mod/manage.php
mod/match.php
mod/message.php
mod/photos.php
mod/suggest.php
mod/unfollow.php
src/Core/Authentication.php
src/Module/Contact.php
src/Module/Login.php

index 2ccdf8fb7236b748be1ef666cee7ed688885f258..4573f44a4546d6f4c5ab4fcc30e5152feb36e513 100644 (file)
@@ -534,7 +534,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
        $page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
 
        if (!$update) {
-               $_SESSION['return_url'] = $a->query_string;
+               $_SESSION['return_path'] = $a->query_string;
        }
 
        $cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
index 9a0da74dcd43fef1ef62394c81f3b0b1a0cc91de..eebccee7694f9a6035b0c28d3ad28d2bfd309b26 100644 (file)
@@ -198,7 +198,7 @@ function events_content(App $a)
        }
 
        if ($a->argc == 1) {
-               $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+               $_SESSION['return_path'] = $a->cmd;
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
index 0c91e09512b1c0be23fdc92c2e2beac429ba8af7..adc3fcc3bd5125465e4c3a0720053869360f8cfb 100644 (file)
@@ -25,7 +25,7 @@ function follow_post(App $a)
 
        $uid = local_user();
        $url = notags(trim($_REQUEST['url']));
-       $return_url = 'contacts';
+       $return_path = 'contacts';
 
        // Makes the connection request for friendica contacts easier
        // This is just a precaution if maybe this page is called somewhere directly via POST
@@ -37,24 +37,24 @@ function follow_post(App $a)
                if ($result['message']) {
                        notice($result['message']);
                }
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
        } elseif ($result['cid']) {
                $a->internalRedirect('contact/' . $result['cid']);
        }
 
        info(L10n::t('The contact could not be added.'));
 
-       $a->internalRedirect($return_url);
+       $a->internalRedirect($return_path);
        // NOTREACHED
 }
 
 function follow_content(App $a)
 {
-       $return_url = 'contacts';
+       $return_path = 'contacts';
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
                // NOTREACHED
        }
 
@@ -74,7 +74,7 @@ function follow_content(App $a)
                if ($r[0]['pending']) {
                        notice(L10n::t('You already added this contact.'));
                        $submit = '';
-                       //$a->internalRedirect($_SESSION['return_url']);
+                       //$a->internalRedirect($_SESSION['return_path']);
                        // NOTREACHED
                }
        }
@@ -84,21 +84,21 @@ function follow_content(App $a)
        if (($ret['network'] == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
                notice(L10n::t("Diaspora support isn't enabled. Contact can't be added."));
                $submit = '';
-               //$a->internalRedirect($_SESSION['return_url']);
+               //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
        }
 
        if (($ret['network'] == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) {
                notice(L10n::t("OStatus support is disabled. Contact can't be added."));
                $submit = '';
-               //$a->internalRedirect($_SESSION['return_url']);
+               //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
        }
 
        if ($ret['network'] == Protocol::PHANTOM) {
                notice(L10n::t("The network type couldn't be detected. Contact can't be added."));
                $submit = '';
-               //$a->internalRedirect($_SESSION['return_url']);
+               //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
        }
 
@@ -118,7 +118,7 @@ function follow_content(App $a)
 
        if (!$r) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
                // NOTREACHED
        }
 
index b5aed6f8b39fb57f89662e3e714f5db597321928..b98fcac6f747bae0c58254b5aa2348dfd0f86d81 100644 (file)
@@ -99,7 +99,7 @@ function manage_post(App $a) {
        unset($_SESSION['theme']);
        unset($_SESSION['mobile-theme']);
        unset($_SESSION['page_flags']);
-       unset($_SESSION['return_url']);
+       unset($_SESSION['return_path']);
        if (x($_SESSION, 'submanage')) {
                unset($_SESSION['submanage']);
        }
index 7e805d5baf4c4d9272e462f5c62a7a365bfd8549..b299619940e670385d4c54f3794d8ff25a5a9c32 100644 (file)
@@ -35,7 +35,7 @@ function match_content(App $a)
        $a->page['aside'] .= Widget::findPeople();
        $a->page['aside'] .= Widget::follow();
 
-       $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+       $_SESSION['return_path'] = $a->cmd;
 
        $r = q(
                "SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
index 418dfc080dd0c83e29da9cb97309aa9356c4886e..8a04f9abef7499f6abaa4ee3f3e04d736cb147f9 100644 (file)
@@ -265,7 +265,7 @@ function message_content(App $a)
        }
 
 
-       $_SESSION['return_url'] = $a->query_string;
+       $_SESSION['return_path'] = $a->query_string;
 
        if ($a->argc == 1) {
 
index 0c77504e1a764dcd0cdef898ceb6af40ffff0fd7..ef6428d7ab563309dbfcb835553ff116cd1e245f 100644 (file)
@@ -1469,7 +1469,7 @@ function photos_content(App $a)
                if (count($linked_items)) {
                        $cmnt_tpl = get_markup_template('comment_item.tpl');
                        $tpl = get_markup_template('photo_item.tpl');
-                       $return_url = $a->cmd;
+                       $return_path = $a->cmd;
 
                        if ($can_post || Security::canWriteToUserWall($owner_uid)) {
                                $like_tpl = get_markup_template('like_noshare.tpl');
@@ -1486,7 +1486,7 @@ function photos_content(App $a)
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
                                        $comments .= replace_macros($cmnt_tpl, [
                                                '$return_path' => '',
-                                               '$jsreload' => $return_url,
+                                               '$jsreload' => $return_path,
                                                '$id' => $link_item['id'],
                                                '$parent' => $link_item['id'],
                                                '$profile_uid' =>  $owner_uid,
@@ -1525,7 +1525,7 @@ function photos_content(App $a)
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
                                        $comments .= replace_macros($cmnt_tpl,[
                                                '$return_path' => '',
-                                               '$jsreload' => $return_url,
+                                               '$jsreload' => $return_path,
                                                '$id' => $link_item['id'],
                                                '$parent' => $link_item['id'],
                                                '$profile_uid' =>  $owner_uid,
@@ -1585,7 +1585,7 @@ function photos_content(App $a)
                                        if (($can_post || Security::canWriteToUserWall($owner_uid))) {
                                                $comments .= replace_macros($cmnt_tpl, [
                                                        '$return_path' => '',
-                                                       '$jsreload' => $return_url,
+                                                       '$jsreload' => $return_path,
                                                        '$id' => $item['item_id'],
                                                        '$parent' => $item['parent'],
                                                        '$profile_uid' =>  $owner_uid,
index 81030842dcdf4dc220d05518e51a6fe2b157600f..1e33cb66024e9d811a3711bb31ef12d2d7c758d0 100644 (file)
@@ -62,7 +62,7 @@ function suggest_content(App $a)
                return;
        }
 
-       $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+       $_SESSION['return_path'] = $a->cmd;
 
        $a->page['aside'] .= Widget::findPeople();
        $a->page['aside'] .= Widget::follow();
index 6ec8a8fdb47027aed8f5d4c07a8e318c5032f50f..2a60322f02d9b2d9043822e8cdaf9c26a8024d70 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Model\User;
 
 function unfollow_post(App $a)
 {
-       $return_url = 'contacts';
+       $return_path = 'contacts';
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
@@ -32,17 +32,17 @@ function unfollow_post(App $a)
 
        if (!DBA::isResult($contact)) {
                notice(L10n::t("You aren't following this contact."));
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
                // NOTREACHED
        }
 
        if (!empty($_REQUEST['cancel'])) {
-               $a->internalRedirect($return_url . '/' . $contact['id']);
+               $a->internalRedirect($return_path . '/' . $contact['id']);
        }
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
                notice(L10n::t('Unfollowing is currently not supported by your network.'));
-               $a->internalRedirect($return_url . '/' . $contact['id']);
+               $a->internalRedirect($return_path . '/' . $contact['id']);
                // NOTREACHED
        }
 
@@ -69,7 +69,7 @@ function unfollow_post(App $a)
 
 function unfollow_content(App $a)
 {
-       $return_url = 'contacts';
+       $return_path = 'contacts';
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
@@ -88,7 +88,7 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($contact)) {
                notice(L10n::t("You aren't following this contact."));
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
                // NOTREACHED
        }
 
@@ -105,7 +105,7 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($self)) {
                notice(L10n::t('Permission denied.'));
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
                // NOTREACHED
        }
 
index 72caa9be43172abfccc3f8e219bea07d177584c6..76d078341f74c0658391f8a53e20fb1950e300a7 100644 (file)
@@ -82,7 +82,7 @@ class Authentication extends BaseObject
 
                if ($interactive) {
                        if ($a->user['login_date'] <= NULL_DATE) {
-                               $_SESSION['return_url'] = 'profile_photo/new';
+                               $_SESSION['return_path'] = 'profile_photo/new';
                                $a->module = 'profile_photo';
                                info(L10n::t("Welcome ") . $a->user['username'] . EOL);
                                info(L10n::t('Please upload a profile photo.') . EOL);
@@ -193,8 +193,8 @@ class Authentication extends BaseObject
                if ($login_initial) {
                        Addon::callHooks('logged_in', $a->user);
 
-                       if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
-                               $a->internalRedirect($_SESSION['return_url']);
+                       if (($a->module !== 'home') && isset($_SESSION['return_path'])) {
+                               $a->internalRedirect($_SESSION['return_path']);
                        }
                }
        }
index 1b19aaadb5249b1a068c677f6ecf7fbcf3e2ecd8..271740a4f5d28eddec6ffba15ae6883a4ef423e7 100644 (file)
@@ -468,7 +468,7 @@ class Contact extends BaseModule
                        }
                }
 
-               $_SESSION['return_url'] = $a->query_string;
+               $_SESSION['return_path'] = $a->query_string;
 
                if (!empty($a->data['contact']) && is_array($a->data['contact'])) {
                        $contact_id = $a->data['contact']['id'];
index 2e04eb83be8e6b21f3515b72ae4c1572822c8904..df918c44c8ed0aee91af7e6e2b774486f4e287f8 100644 (file)
@@ -43,14 +43,14 @@ class Login extends BaseModule
                        $a->internalRedirect();
                }
 
-               return self::form($_SESSION['return_url'], intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
+               return self::form($_SESSION['return_path'], intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
        }
 
        public static function post()
        {
-               $return_url = $_SESSION['return_url'];
+               $return_path = $_SESSION['return_path'];
                session_unset();
-               $_SESSION['return_url'] = $return_url;
+               $_SESSION['return_path'] = $return_path;
                
                // OpenId Login
                if (
@@ -160,14 +160,14 @@ class Login extends BaseModule
                $_SESSION['last_login_date'] = DateTimeFormat::utcNow();
                Authentication::setAuthenticatedSessionForUser($record, true, true);
 
-               if (x($_SESSION, 'return_url')) {
-                       $return_url = $_SESSION['return_url'];
-                       unset($_SESSION['return_url']);
+               if (x($_SESSION, 'return_path')) {
+                       $return_path = $_SESSION['return_path'];
+                       unset($_SESSION['return_path']);
                } else {
-                       $return_url = '';
+                       $return_path = '';
                }
 
-               $a->internalRedirect($return_url);
+               $a->internalRedirect($return_path);
        }
 
        /**
@@ -269,7 +269,7 @@ class Login extends BaseModule
        /**
         * @brief Wrapper for adding a login box.
         *
-        * @param string $return_url The url relative to the base the user should be sent
+        * @param string $return_path The path relative to the base the user should be sent
         *                                                       back to after login completes
         * @param bool $register If $register == true provide a registration link.
         *                                               This will most always depend on the value of config.register_policy.
@@ -279,7 +279,7 @@ class Login extends BaseModule
         *
         * @hooks 'login_hook' string $o
         */
-       public static function form($return_url = null, $register = false, $hiddens = [])
+       public static function form($return_path = null, $register = false, $hiddens = [])
        {
                $a = self::getApp();
                $o = '';
@@ -293,8 +293,8 @@ class Login extends BaseModule
 
                $noid = Config::get('system', 'no_openid');
 
-               if (is_null($return_url)) {
-                       $return_url = $a->query_string;
+               if (is_null($return_path)) {
+                       $return_path = $a->query_string;
                }
 
                if (local_user()) {
@@ -308,7 +308,7 @@ class Login extends BaseModule
                        );
 
                        $tpl = get_markup_template('login.tpl');
-                       $_SESSION['return_url'] = $return_url;
+                       $_SESSION['return_path'] = $return_path;
                }
 
                $o .= replace_macros(