X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffollow.php;h=04c279c5b6ab707f5995aa0c229e412613082d50;hb=f8b74033a4f990e421814ea5bf8b443104e61feb;hp=65028a70e007fb1d7f4c2e61c74cc921aa7e2840;hpb=c083ae047c4259dcfa1c61a3795679bbf1b08d8c;p=friendica.git diff --git a/mod/follow.php b/mod/follow.php index 65028a70e0..04c279c5b6 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -20,19 +20,18 @@ function follow_post(App $a) } if (isset($_REQUEST['cancel'])) { - goaway($_SESSION['return_url']); + goaway('contacts'); } $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 $_SESSION['fastlane'] = $url; - $result = Contact::createFromProbe($uid, $url, true, Protocol::ACTIVITYPUB); -// $result = Contact::createFromProbe($uid, $url, true); + $result = Contact::createFromProbe($uid, $url, true); if ($result['success'] == false) { if ($result['message']) { @@ -40,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.')); @@ -51,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 } @@ -117,7 +118,7 @@ function follow_content(App $a) if (!$r) { notice(L10n::t('Permission denied.')); - goaway($_SESSION['return_url']); + goaway($return_url); // NOTREACHED }