]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Search.php
Merge pull request #12578 from MrPetovan/bug/warnings
[friendica.git] / src / Core / Search.php
index 0065274a3a67e3f15c9209370c7fefbcccb1595b..c41df70d9bf5f2db39cf2712a2cdf75fab3bc121 100644 (file)
@@ -70,7 +70,7 @@ class Search
                                return $emptyResultList;
                        }
 
-                       $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user());
+                       $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', DI::userSession()->getLocalUserId());
 
                        $result = new ContactResult(
                                $user_data['name'] ?? '',
@@ -102,7 +102,7 @@ class Search
         * @return ResultList
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function getContactsFromGlobalDirectory(string $search, int$type = self::TYPE_ALL, int $page = 1): ResultList
+       public static function getContactsFromGlobalDirectory(string $search, int $type = self::TYPE_ALL, int $page = 1): ResultList
        {
                $server = self::getGlobalDirectory();
 
@@ -136,7 +136,7 @@ class Search
 
                foreach ($profiles as $profile) {
                        $profile_url = $profile['profile_url'] ?? '';
-                       $contactDetails = Contact::getByURLForUser($profile_url, local_user());
+                       $contactDetails = Contact::getByURLForUser($profile_url, DI::userSession()->getLocalUserId());
 
                        $result = new ContactResult(
                                $profile['name'] ?? '',
@@ -192,7 +192,7 @@ class Search
                }
 
                // Add found profiles from the global directory to the local directory
-               Worker::add(PRIORITY_LOW, 'SearchDirectory', $search);
+               Worker::add(Worker::PRIORITY_LOW, 'SearchDirectory', $search);
 
                return $resultList;
        }
@@ -211,7 +211,7 @@ class Search
        {
                Logger::info('Searching', ['search' => $search, 'mode' => $mode, 'page' => $page]);
 
-               if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+               if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
                        return [];
                }