diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-21 14:15:29 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-21 14:15:29 -0700 |
commit | 222186d5f7b67c3ddb0e358477cf9c291b0c58d6 (patch) | |
tree | ea1a19997fee92b465da2f0e6223928eee731171 /Zotlabs | |
parent | 632ad7d7f9236bc68f042030ad68cefb6c74e7f7 (diff) | |
download | volse-hubzilla-222186d5f7b67c3ddb0e358477cf9c291b0c58d6.tar.gz volse-hubzilla-222186d5f7b67c3ddb0e358477cf9c291b0c58d6.tar.bz2 volse-hubzilla-222186d5f7b67c3ddb0e358477cf9c291b0c58d6.zip |
fine tune the navbar people autocomplete, as the check for minimum length wasn't taking into consideration the initial tag character, and one char search provides way too many results. The autocomplete cache doesn't search again but just searches through its cache. This means as you type more chars, if the answer wasn't included in the very first search (one char), it won't be returned. This may need further tweaking as the network grows.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Acl.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 29c1e5280..0215b2125 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -354,7 +354,7 @@ class Acl extends \Zotlabs\Web\Controller { $dirmode = intval(get_config('system','directory_mode')); $search = ((x($_REQUEST,'search')) ? htmlentities($_REQUEST['search'],ENT_COMPAT,'UTF-8',false) : ''); - if(! $search || mb_strlen($search) < 2) + if(! $search) return array(); $star = false; @@ -371,6 +371,9 @@ class Acl extends \Zotlabs\Web\Controller { if(strpos($search,'@') !== false) { $address = true; } + + if(mb_strlen($search) < 3) + return array(); if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) { $url = z_root() . '/dirsearch'; |