<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*/
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\DI;
$uid = local_user();
- // Issue 4815: Silently removing a prefixing @
- $url = ltrim(Strings::escapeTags(trim($_REQUEST['url'] ?? '')), '@!');
+ $url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
// Issue 6874: Allow remote following from Peertube
if (strpos($url, 'acct:') === 0) {
// Don't try to add a pending contact
$user_contact = DBA::selectFirst('contact', ['pending'], ["`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND
- (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
+ (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
$uid, Contact::FOLLOWER, Protocol::DFRN, Strings::normaliseLink($url),
Strings::normaliseLink($url), $url, Protocol::STATUSNET]);
DI::page()['aside'] = '';
- if ($protocol != Protocol::PHANTOM) {
- Profile::load($a, '', $contact, false);
+ if (!in_array($protocol, [Protocol::PHANTOM, Protocol::MAIL])) {
+ DI::page()['aside'] = Widget\VCard::getHTML($contact);
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
['$title' => DI::l10n()->t('Status Messages and Posts')]
{
$return_path = 'follow?url=' . urlencode($url);
- $result = Contact::createFromProbe($a->user, $url, true);
+ $result = Contact::createFromProbeForUser($a->getLoggedInUserId(), $url);
if ($result['success'] == false) {
// Possibly it is a remote item and not an account