]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Search/Acl.php
Use rawContent for Special Options to avoid a protected options() method
[friendica.git] / src / Module / Search / Acl.php
index 33d9e32c18ea0b663eb5b85c9c3ef163b59133da..4fbc30ef9ee68c67975171b7ec77ad817cbe593c 100644 (file)
@@ -1,6 +1,6 @@
 <?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
  *
@@ -32,7 +32,6 @@ use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Post;
 use Friendica\Network\HTTPException;
-use Friendica\Util\Strings;
 
 /**
  * ACL selector json backend
@@ -49,7 +48,7 @@ class Acl extends BaseModule
        const TYPE_PRIVATE_MESSAGE       = 'm';
        const TYPE_ANY_CONTACT           = 'a';
 
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
@@ -69,7 +68,7 @@ class Acl extends BaseModule
        private static function globalContactSearch()
        {
                // autocomplete for global contact search (e.g. navbar search)
-               $search = Strings::escapeTags(trim($_REQUEST['search']));
+               $search = trim($_REQUEST['search']);
                $mode = $_REQUEST['smode'];
                $page = $_REQUEST['page'] ?? 1;
 
@@ -138,10 +137,14 @@ class Acl extends BaseModule
                                $condition = DBA::mergeConditions($condition,
                                        ["NOT `self` AND NOT `blocked` AND `notify` != ? AND NOT `network` IN (?, ?)", '', Protocol::OSTATUS, Protocol::STATUSNET
                                ]);
+                               break;
+
                        case self::TYPE_MENTION_CONTACT:
                                $condition = DBA::mergeConditions($condition,
                                        ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::STATUSNET
                                ]);
+                               break;
+
                        case self::TYPE_MENTION_FORUM:
                                $condition = DBA::mergeConditions($condition,
                                        ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `contact-type` = ?", '', Contact::TYPE_COMMUNITY