]> git.mxchange.org Git - friendica.git/commitdiff
replace session return url by static pages
authorJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 30 Sep 2018 17:03:05 +0000 (19:03 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 30 Sep 2018 17:03:05 +0000 (19:03 +0200)
mod/follow.php
mod/unfollow.php

index 627ab52033049065a9d737fdf8c725068215c121..f70a8610e4d19a30e2d124a516f0b0d35e6f35af 100644 (file)
@@ -25,7 +25,7 @@ function follow_post(App $a)
 
        $uid = local_user();
        $url = notags(trim($_REQUEST['url']));
-       $return_url = $_SESSION['return_url'];
+       $return_url = 'contacts';
 
        // Makes the connection request for friendica contacts easier
        // This is just a precaution if maybe this page is called somewhere directly via POST
@@ -39,7 +39,7 @@ function follow_post(App $a)
                }
                goaway($return_url);
        } elseif ($result['cid']) {
-               goaway(System::baseUrl() . '/contacts/' . $result['cid']);
+               goaway('contacts/' . $result['cid']);
        }
 
        info(L10n::t('The contact could not be added.'));
@@ -50,9 +50,11 @@ function follow_post(App $a)
 
 function follow_content(App $a)
 {
+       $return_url = 'contacts';
+
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
+               goaway($return_url);
                // NOTREACHED
        }
 
@@ -116,7 +118,7 @@ function follow_content(App $a)
 
        if (!$r) {
                notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
+               goaway($return_url);
                // NOTREACHED
        }
 
index b80263a3ecd33349047e177f8ff964547b4c56d8..61f99ee489170ffbc2a2b0b81793407d3dc08092 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Model\User;
 
 function unfollow_post()
 {
-       $return_url = $_SESSION['return_url'];
+       $return_url = 'contacts';
 
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
@@ -42,7 +42,7 @@ function unfollow_post()
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
                notice(L10n::t('Unfollowing is currently not supported by your network.'));
-               goaway($return_url);
+               goaway($return_url.'/'.$contact['id']);
                // NOTREACHED
        }
 
@@ -69,9 +69,11 @@ function unfollow_post()
 
 function unfollow_content(App $a)
 {
+       $return_url = 'contacts';
+
        if (!local_user()) {
                notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
+               goaway($return_url);
                // NOTREACHED
        }
 
@@ -86,7 +88,7 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($contact)) {
                notice(L10n::t("You aren't following this contact."));
-               goaway('contacts');
+               goaway($return_url);
                // NOTREACHED
        }
 
@@ -103,7 +105,7 @@ function unfollow_content(App $a)
 
        if (!DBA::isResult($self)) {
                notice(L10n::t('Permission denied.'));
-               goaway($_SESSION['return_url']);
+               goaway($return_url);
                // NOTREACHED
        }