DI::baseUrl()->redirect('contact');
}
- follow_process($a);
+ $url = Probe::cleanURI($_REQUEST['url']);
+
+ follow_process($a, $url);
}
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
// Makes the connection request for friendica contacts easier
$_SESSION['fastlane'] = $contact['url'];
+ if (!empty($_REQUEST['auto'])) {
+ follow_process($a, $contact['url']);
+ }
+
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Connect/Follow'),
'$pls_answer' => DI::l10n()->t('Please answer the following:'),
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
// NOTREACHED
}
- unfollow_process();
+ $url = Strings::escapeTags(trim($_REQUEST['url'] ?? ''));
+
+ unfollow_process($url);
}
function unfollow_content(App $a)
// NOTREACHED
}
- if (!empty($_REQUEST['auto'])) {
- unfollow_process();
- }
-
$uid = local_user();
$url = Strings::escapeTags(trim($_REQUEST['url']));
// Makes the connection request for friendica contacts easier
$_SESSION['fastlane'] = $contact['url'];
+ if (!empty($_REQUEST['auto'])) {
+ unfollow_process($contact['url']);
+ }
+
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Disconnect/Unfollow'),
'$page_desc' => '',
return $o;
}
-function unfollow_process()
+function unfollow_process(string $url)
{
$base_return_path = 'contact';
$uid = local_user();
- $url = Strings::escapeTags(trim($_REQUEST['url'] ?? ''));
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
$uid, Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),