]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Avoid a notice
[friendica.git] / mod / follow.php
index 65028a70e007fb1d7f4c2e61c74cc921aa7e2840..04c279c5b6ab707f5995aa0c229e412613082d50 100644 (file)
@@ -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
        }