From fc31ecdab0abdd5ca83723c2c1da2f711016c274 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 30 May 2018 17:30:17 -0700 Subject: autocomplete private mail addresses based on substring in either the name or webbie (prevously required an '@' to trigger a webbie search) --- Zotlabs/Module/Acl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 2678aeb7a..7b52e88b5 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -94,8 +94,7 @@ class Acl extends \Zotlabs\Web\Controller { . " then POSITION('" . protect_sprintf(dbesc($search)) . "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, "; - $col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' ); - $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc(($col === 'xchan_addr') ? punify($search) : $search) . "%'" ) . " "; + $sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) "; } else { -- cgit v1.2.3