]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact.php
Fix tests
[friendica.git] / src / Module / Contact.php
index 235b8488abf45542c301259df5a1ad72cf902c61..2609a5b8bfc3da6086516b24bf9d1b343bde159e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -413,6 +413,10 @@ class Contact extends BaseModule
                        }
 
                        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());
@@ -423,6 +427,10 @@ class Contact extends BaseModule
                        }
 
                        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());
@@ -642,11 +650,11 @@ class Contact extends BaseModule
                                '$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:'),
@@ -1103,7 +1111,7 @@ class Contact extends BaseModule
                        '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'],