<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
}
if ($cmd === 'block') {
+ if (public_contact() === $contact_id) {
+ throw new BadRequestException(DI::l10n()->t('You can\'t block yourself'));
+ }
+
self::blockContact($contact_id);
$blocked = Model\Contact\User::isBlocked($contact_id, local_user());
}
if ($cmd === 'ignore') {
+ if (public_contact() === $contact_id) {
+ throw new BadRequestException(DI::l10n()->t('You can\'t ignore yourself'));
+ }
+
self::ignoreContact($contact_id);
$ignored = Model\Contact\User::isIgnored($contact_id, local_user());
'$profileurllabel'=> DI::l10n()->t('Profile URL'),
'$profileurl' => $contact['url'],
'$account_type' => Model\Contact::getAccountType($contact),
- '$location' => BBCode::convert($contact['location']),
+ '$location' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['location']),
'$location_label' => DI::l10n()->t('Location:'),
- '$xmpp' => BBCode::convert($contact['xmpp']),
+ '$xmpp' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['xmpp']),
'$xmpp_label' => DI::l10n()->t('XMPP:'),
- '$about' => BBCode::convert($contact['about'], false),
+ '$about' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['about'], BBCode::EXTERNAL),
'$about_label' => DI::l10n()->t('About:'),
'$keywords' => $contact['keywords'],
'$keywords_label' => DI::l10n()->t('Tags:'),
'url' => $url,
'img_hover' => DI::l10n()->t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'photo_menu' => Model\Contact::photoMenu($contact),
- 'thumb' => Model\Contact::getThumb($contact, '', true),
+ 'thumb' => Model\Contact::getThumb($contact, true),
'alt_text' => $alt_text,
'name' => $contact['name'],
'nick' => $contact['nick'],