]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Search/Acl.php
Merge pull request #8048 from MrPetovan/bug/fix-bbcode-scaleexternalimage
[friendica.git] / src / Module / Search / Acl.php
index 9c99d1fc96b0acd7c1e39fface379747ae772d27..74ce55fb53597a66d29ba705a3ded9458d3acdd0 100644 (file)
@@ -23,15 +23,15 @@ use Friendica\Util\Strings;
  */
 class Acl extends BaseModule
 {
-       const TYPE_GLOBAL_CONTACT = 'x';
-       const TYPE_MENTION_CONTACT = 'c';
-       const TYPE_MENTION_GROUP = 'g';
+       const TYPE_GLOBAL_CONTACT        = 'x';
+       const TYPE_MENTION_CONTACT       = 'c';
+       const TYPE_MENTION_GROUP         = 'g';
        const TYPE_MENTION_CONTACT_GROUP = '';
-       const TYPE_MENTION_FORUM = 'f';
-       const TYPE_PRIVATE_MESSAGE = 'm';
-       const TYPE_ANY_CONTACT = 'a';
+       const TYPE_MENTION_FORUM         = 'f';
+       const TYPE_PRIVATE_MESSAGE       = 'm';
+       const TYPE_ANY_CONTACT           = 'a';
 
-       public static function rawContent()
+       public static function rawContent(array $parameters = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this module.'));
@@ -275,8 +275,8 @@ class Acl extends BaseModule
                                        'id'      => intval($g['id']),
                                        'network' => $g['network'],
                                        'link'    => $g['url'],
-                                       'nick'    => htmlentities(defaults($g, 'attag', $g['nick'])),
-                                       'addr'    => htmlentities(defaults($g, 'addr', $g['url'])),
+                                       'nick'    => htmlentities(($g['attag'] ?? '') ?: $g['nick']),
+                                       'addr'    => htmlentities(($g['addr'] ?? '') ?: $g['url']),
                                        'forum'   => !empty($g['forum']) || !empty($g['prv']) ? 1 : 0,
                                ];
                                if ($entry['forum']) {
@@ -336,8 +336,8 @@ class Acl extends BaseModule
                                                'id'      => intval($contact['cid']),
                                                'network' => $contact['network'],
                                                'link'    => $contact['url'],
-                                               'nick'    => htmlentities(defaults($contact, 'nick', $contact['addr'])),
-                                               'addr'    => htmlentities(defaults($contact, 'addr', $contact['url'])),
+                                               'nick'    => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']),
+                                               'addr'    => htmlentities(($contact['addr'] ?? '') ?: $contact['url']),
                                                'forum'   => $contact['forum']
                                        ];
                                }