From 0a699be3c0d505762f24843c3939fe97ad300563 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Sun, 30 Sep 2018 19:03:05 +0200 Subject: [PATCH] replace session return url by static pages --- mod/follow.php | 10 ++++++---- mod/unfollow.php | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mod/follow.php b/mod/follow.php index 627ab52033..f70a8610e4 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -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 } diff --git a/mod/unfollow.php b/mod/unfollow.php index b80263a3ec..61f99ee489 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -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 }