X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffollow.php;h=ed8e3aa5fee881bd470d308be901fa3adb613809;hb=48a783c91a4fdff2182deb5d137712386f9f3086;hp=4f0c3fc6fe4543ed66f40c2483ec93999df9df3f;hpb=33575a94fa009c479e6c9eb330fad317e5c92d2f;p=friendica.git diff --git a/mod/follow.php b/mod/follow.php index 4f0c3fc6fe..ed8e3aa5fe 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -1,6 +1,6 @@ redirect('contact'); } - follow_process($a); + $url = Probe::cleanURI($_REQUEST['url']); + + follow_process($a, $url); } function follow_content(App $a) @@ -68,10 +71,6 @@ function follow_content(App $a) DI::baseUrl()->redirect($return_path); } - if (!empty($_REQUEST['auto'])) { - follow_process($a); - } - $submit = DI::l10n()->t('Submit Request'); // Don't try to add a pending contact @@ -123,6 +122,10 @@ function follow_content(App $a) $request = $contact['request']; $tpl = Renderer::getMarkupTemplate('dfrn_request.tpl'); } else { + if (!empty($_REQUEST['auto'])) { + follow_process($a, $contact['url']); + } + $request = DI::baseUrl() . '/follow'; $tpl = Renderer::getMarkupTemplate('auto_request.tpl'); } @@ -175,9 +178,8 @@ function follow_content(App $a) return $o; } -function follow_process(App $a) +function follow_process(App $a, string $url) { - $url = Probe::cleanURI($_REQUEST['url']); $return_path = 'follow?url=' . urlencode($url); // Makes the connection request for friendica contacts easier @@ -212,7 +214,7 @@ function follow_remote_item($url) } if (!empty($item_id)) { - $item = Item::selectFirst(['guid'], ['id' => $item_id]); + $item = Post::selectFirst(['guid'], ['id' => $item_id]); if (DBA::isResult($item)) { DI::baseUrl()->redirect('display/' . $item['guid']); }