]> git.mxchange.org Git - friendica.git/commitdiff
Move search term emptiness check before content checks in Search\Index
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 24 Dec 2019 22:17:27 +0000 (17:17 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 24 Dec 2019 22:17:35 +0000 (17:17 -0500)
src/Module/Search/Index.php

index 8921c07aa60edf919bcf136fafacb117ac83068b..691fc3ec8977cfb6c9ab6ba5e7bbad9864fb43cb 100644 (file)
@@ -82,6 +82,10 @@ class Index extends BaseSearchModule
                        '$content' => HTML::search($search, 'search-box', false)
                ]);
 
+               if (!$search) {
+                       return $o;
+               }
+
                if (strpos($search, '#') === 0) {
                        $tag = true;
                        $search = substr($search, 1);
@@ -115,10 +119,6 @@ class Index extends BaseSearchModule
                        }
                }
 
-               if (!$search) {
-                       return $o;
-               }
-
                $tag = $tag || Config::get('system', 'only_tag_search');
 
                // Here is the way permissions work in the search module...