]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Search.php
Merge pull request #8710 from annando/fix-vid
[friendica.git] / src / Core / Search.php
index 841572374276c6697e579c62980c852f5deae342..32090733c4d692e4d9e07156bcb069ca5ecf5827 100644 (file)
@@ -142,7 +142,7 @@ class Search
                $profiles = $results['profiles'] ?? [];
 
                foreach ($profiles as $profile) {
-                       $profile_url = $profile['profile_url'] ?? '';
+                       $profile_url = $profile['url'] ?? '';
                        $contactDetails = Contact::getDetailsByURL($profile_url, local_user());
 
                        $result = new ContactResult(
@@ -311,4 +311,19 @@ class Search
        {
                return DI::config()->get('system', 'directory', self::DEFAULT_DIRECTORY);
        }
+
+       /**
+        * Return the search path (either fulltext search or tag search)
+        *
+        * @param string $search
+        * @return string search path
+        */
+       public static function getSearchPath(string $search)
+       {
+               if (substr($search, 0, 1) == '#') {
+                       return 'search?tag=' . urlencode(substr($search, 1));
+               } else {
+                       return 'search?q=' . urlencode($search);
+               }
+       }
 }